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.