--First of all, congratulations, this is the tenth order. --why the tenth one to congratulate? Nothing special? --because every ten into one ah!
The purpose of the cat command is to connect files or standard input and print. This command is commonly used to display the contents of a file, or to connect several files to display, or to read from a standard input and display it, often in conjunction with redirection symbols.
1. Command format:
Cat [Options] [file]
2. Command function:
There are three major features of cat:
1. Display the entire file at once: Cat filename
2. Create a file from the keyboard: cat > FileName can only create new files, cannot edit existing files
3. Merge several files into one file: Cat file1 file2 > File3
3. Command parameters:
-a--show-all equivalent to-vet
-B--number-nonblank number of non-null output lines
-e equivalent to-ve
-e--show-ends display at the end of each line
-N--number the number of all rows of the output, starting from 1 for the number of rows for all outputs
-S--squeeze-blank a blank line that has more than two lines in a row and is substituted for a row
-T equivalent to-VT
-T--show-tabs to display the jump character as ^i
-U (ignored)
-V--show-nonprinting use ^ and M-references, except LFD and TAB
4. Usage examples:
Example one: The 001.log file content with the line number after input 002.log this file
Cat-n 001.log > 002.log, copy Other people's orders, the results have been no results, later found that he wrote is Cat-n 001.log 002.log, Pit dead. I have a chance to hang out after the pit.
Command decomposition: Cat-n 001.log, with line number output, > 002.log specified input
Example two: Using here doc to generate files
Output:
[email protected] ack]# cat > Log.txt <<eof
>hold
>door
>pwd=$ (PWD)
>eof
[email protected] ack]# Cat Log.txt
Hold
Door
Pwd=/root/ack
Note:
TAC (Reverse list )
Output:
[Email protected] ack]# TAC Log.txt
Pwd=/root/ack
Door
Hold
Description: The TAC is writing cat in turn, so its function is in contrast to cat, where cat is continuously displayed on the screen from the first line to the last row, while the TAC is displayed on the screen in reverse from the last line to the first line.
Every day a Linux command (TEN)--cat command