-v, –show-nonprinting use ^ and M- notation, except for LFD and TAB
–help display this help and exit
–version output version information and exit
Copy standard input to standard output.
➜ ~ cat
Add the line number of the file(including the blank line) to another file
➜ ~ cat -n examples.txt > test.txt
Add the line number of the file (excluding the blank line) and enter it into another file.
➜ ~ cat -b examples.txt > test.txt
Append file content to another file content
➜ ~ cat examples.txt >> test.txt
> :overwrite write>> :append write
Empty file contents
In Linux, the null device is basically utilized for discarding of unwanted output streams of a process, or else as a suitable empty file for input streams. This is normally done by redirection mechanism.
And the /dev/null device file is therefore a special file that writes-off (removes) any input sent to it or its output is same as that of an empty file.
➜ ~ cat /dev/null > test.txt
In server operation, we usually use this method to clear the log file.
You can also use the echo command to achieve the same purpose.
➜ ~ echo "" > test.txt
➜ ~ echo > test.txt