Cat for Linux shell commands

Source: Internet
Author: User
Tags linux shell commands

Cat for Linux shell commands
Cat: view the file content, connect to the file, create one or more files, and redirect the output to the terminal or file. Usage: cat [Option] [file] 1. $ cat hello.txt displays the content in the hello.txt text file 2. $ cat-n file-n option. The file content and row number can be displayed. $ cat-B file-B option, similar to-n, but only identifies the row number of non-blank rows (blank rows are still displayed) 4. the $ cat-e file-e Option displays the "$" character at the end of each row, which is useful when you need to convert multiple rows into a row. 5. $ cat only enters the cat command. It only receives the standard input content and displays it in the standard output. Therefore, the same content will be displayed in the next line after you enter a line and press Enter. For example, $ cat hello world! Hello world! $ Redirection: $ cat> hello world! (Press ctrl + D to exit. The input content is hello world! Write to file hello) $ cat hello world! The $ redirection operator has two types:> and>. The former is content overwrite, and the latter is appended at the end of the file. 6. Connect the content of multiple files to a new file $ cat test test1> test2 $ cat test2. The results will show the content in test and test1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.