Cat: View the contents of a file, connect a file, create one or more files, and redirect output to a terminal or file usage: cat [options] [file]
1. $ Cat Hello.txt
displaying content in a hello.txt text file
2. $ cat-n File
-N option to display the contents and line numbers of a file
3. $ cat-b File
-b option, similar to-N, but only identifies line numbers for non-blank lines
4. $ cat-e File
The-e option, which displays the "$" character at the end of each line, is useful when you need to convert multiple lines of content into a single line.
5. $ cat
If you enter only the cat command, it simply receives the standard input and displays it in the standard output, so when you enter a line and press ENTER, the same content is displayed on the next line.
such as: $ cat
Hello world!
Hello world!
$
REDIRECT words:
$ cat >hello
Hello world!
(ctrl+d key combination exits, the input of the content Hello world! will be written to the file Hello)
$ cat Hello
Hello world!
$
There are two redirect operators: > and >>, the former is content overlay, and the latter is the last append of the most files.
6. Connect the contents of multiple files to a new file
$ cat Test test1 > Test2
$ cat Test2
The results will display the contents of test and test1.
Linux shell Command Cat