Note: After the awk command, there are not too many complex commands, which are basic commands.
Description
Cat, which is the abbreviation of the word concatenate, outputs the contents of the file to stdout. When the redirection operator (> or
When used in conjunction with >>, it is commonly used to connect multiple files.
Usage:
1. $cat file1 file2 File3
2. Not only can read the content from the file and stitching, but also from the standard input stream to read
For example: $echo ' some content ' | Cat-file.txt
Explanation: Here's-represents the ' some content ' temporary file, which is the input stream
Instance:
1. $cat Cat.txt
Printed all the contents of the Cat.txt
2. $cat Cat.txt | Less
View Cat.txt, add less a page after the screen, specifically after the Less,more command introduced
3. $cat-N Cat.txt
Callout line number before each line, including blank lines
4. $cat-B cat.txt
Callout line number before blank line
Interpreting--help
Usage: cat [options] ... [File] ...
Outputs a [file] or a standard input combination to the standard output.
-A,--show-all equals-vet
-B,--number-nonblank for non-null output line numbering
-E equals-ve
-E,--show-ends displays "$" at the end of each line
-N,--number all line numbers for the output
-S,--squeeze-blank does not output multiple lines of blank lines
-T and-VT equivalence
-T,--show-tabs displays the ^i character as a
-U (ignored)
-V,--show-nonprinting use ^ and M references, except LFD and TAB
--HELP displays this help information and exits
--version display version information and exit
If no file is specified, or if the file is "-", read from the standard input.
Example:
The cat f-g first outputs the contents of F, then outputs the contents of the standard input, and finally outputs the contents of G.
Cat copies the standard input to the standard output.
Interpretation:
1. Cat–s file.txt
If there is a file in this format:
Line1
#空行
Line2 File2
To use this command
Cat more with the other command, its own not too complex content, if bored, try Cat–a cat.txt, there will be unforgettable memories.
Related commands:
Cat's in-laws are usually sed,tr this order.
Such as:
$cat file|sed ' s/old/new/g '
Displays the file and converts the old to new without modifying the original file