command based on CENTOS6 series, translated based on the meaning of the official text.
Cat
cat-concatenatefiles and print on the standard output Connection file and print standard output
Cat [OPTION] ... [FILE] ...
DESCRIPTION Description
Concatenate FILE (s), or standard input,to standard output.
-A,--show-all
Equivalent To-vet
-B,--number-nonblank
Number nonempty output lines
-e equivalent To-ve
-E,--show-ends
Display $ at end of each line
-N,--number
Number all output lines
-S,--squeeze-blank
Suppress repeated empty outputlines
-T equivalent TO-VT
-T,--show-tabs
Display TAB characters as ^i
-U (ignored)
-V,--show-nonprinting
Use ^ and m-notation, except FORLFD and TAB
-A Show All and take $ the symbol shows the end, equivalent to -vet , and the utility degree is low.
- b displays all non-empty line numbers. That is, if it is a blank line, the line number is not displayed
- N Displays line numbers for all lines, including blank lines, etc., commonly used
- S compressed blank lines, understood to encounter more than three lines of empty lines, only one row, chicken ribs parameter
Cat of the concatenate Usage:
To create or direct a file for the input content, format:
cat>>file<< xxx content xxx End
Of course, you can cat> or >>file directly.
Merging cat file1 file2 > File3
Cases:
[Email protected]]# cat >>1.TXT<<ABC
>1234567
>abc
[[Email protected]]# cat>2.txt
Abcdefg
^c
[[Email protected]]# cat 1.txt 2.txt
1234567
Abcdefg
[[Email protected]]# cat 1.txt 2.txt > 3.txt
[[Email protected]]# cat 3.txt
1234567
Abcdefg
the above uses the 2 different ways of creating files and merging the content together.
Print standard output :
Cat+option+file will be Linux all know, don't introduce
Summary: Cat is described in official info, and his usage is to connect and output file contents. It's just that very few people use it in the connection section. Most people only know cat print standard output. When you want to write a simple script, you can write it directly with Cat. Equivalent to an enhanced echo. Practical work is very practical.
This article is from the "Mud" blog, be sure to keep this source http://niba666.blog.51cto.com/9238216/1873555
Deep usage of Linux cat