The function of the Cat command is to connect files or standard input and print, and today we will introduce you to the cat commands in Linux.
For more information on Linux commands, see: Linux Command Quick check manual
Linux's cat commands are typically used to display file content or to connect several files to display, or to read from standard input and display, often in conjunction with redirection symbols.
First, the Linux Cat command syntax format
Cat [OPTION] ... [FILE]:
Parameter description:
-A,--show-all equivalent to-vet-b,--number-nonblank to non-null output line number-e equivalent to-VE-E,--show-ends show $-n at the end of each line,--number for all line numbers of the output, the number of rows starting at 1 for all outputs is number-S,--squeeze-blank has two consecutive lines above the blank line, the substitution is a line of blank lines-t and-VT equivalent-T,--show-tabs Display the tab character as ^i-u (ignored)-V,--show-nonprinting with ^ and M-references, except LFD and TAB
Ii. examples of use of Linux cat commands
1) Display the contents of the file
#cat File1this is a test file. Welcome to Linuxdaxue.com!this is Cat command test.
2) Enter the File1 content and line number into the File2
#cat-n file1 > File2[[email protected]/root/linuxdaxue.com/testdir] #cat file2 1 This is a test file. 2 Welcome to linuxdaxue.com! 3 This is Cat command test.
3) Empty file2 content
#cat/dev/null > File2#cat file2#
4) Linux TAC command
The TAC is cat in turn, and the function is the opposite of cat, which is used to output files from back to forward.
Here are the differences between the two commands
[Email Protected]/root/linuxdaxue.com/testdir] #cat file1this is a test file. Welcome to Linuxdaxue.com!this is Cat command test. [Email Protected]/root/linuxdaxue.com/testdir] #tac file1this is cat command test. Welcome to Linuxdaxue.com!this is a test file.
Well, the contents of the Linux Cat command are described here, for more information on Linux commands see: Linux command Quick check manual
- Copyright Notice: original article, 3 months ago, published by the University of Linux (linuxdaxue.com), a total of 1015 words.
- reprint Please specify: Linux Command-cat Command | Linux University
Linux Command-cat command