ArticleDirectory
- Parameters
- Option
- Example
Connect or display files
Cat[Options] [File-list]
Parameters
File-listYesCatThe path name of a single file to be processed or the list of path names of multiple files. If no parameter is specified or a hyphen (-) is specified to replace the file name, cat reads the information from the standard input and prints
Option
-E: display at the end of each line $
-N: Number of all rows output
-B indicates the numbers of all non-empty rows in the output.
-S: deletes multiple consecutive blank rows. Only one row is retained.
-T use ^ I to display each tab (Tab)
Example Cat-
$CatHellohello $Cat-Worldworld
Read and print, CTRL + D indicates exit
Cat-e
$Cat-All people who can make an appointment with E demo $
Dollar sign printed at the end of the sentence
Cat-n
$Cat-N demo1All people who can make an appointment234Enough food to eat567I am very talkative.89Desperate than crying10How can this problem be solved?
Number of all rows
Cat-B
$Cat-B demo1All people who can make an appointment2Enough food to eat3I am very talkative.4Desperate than crying5How can this problem be solved?
All non-empty row numbers
Cat-S
All the people who can make an appointment are about to eat enough food, so they can use their power to talk about laughter and cry. How can they get beaten?
Delete unnecessary blank rows
Cat-T
$Cat-T the demo can be used by people who can make an appointment.^ I use ^ I force ^ I ^I laugh than cry, how can I get beaten?
Print the tab to ^ I
Cat> File
$Cat>A.txt hello
Write to the file and press Ctrl + D to exit. In addition,> used to append data, rather than Overwrite
Cat file File> File
$CatA.txt B .txt>C.txt $CatC.txt helloworld
Connect multiple files to the same file
Tips
1. Cat is used to display short character files. The effect is very good.
2. Cat can splice multiple files. In addition, the file splitting method is also described later.