cat(1)cat(1)Namecat - concatenate and print data
Syntaxcat [ -b ] [ -e ] [ -n ] [ -s ] [ -t ] [ -u ] [ -v ] file...
The command reads each file in sequence and displays it on the standard
output. Therefore, to display the file on the standard output you
To concatenate two files and place the result on the third you type:
cat file1 file2 > file3
To concatenate two files and append them to a third you type:
cat file1 file2 >> file3
If no input file is given, or if a minus sign (-) is encountered as an
argument, reads from the standard input file. Output is buffered in
1024-byte blocks unless the standard output is a terminal, in which
case it is line buffered. The utility supports the processing of 8-bit
Options-b Ignores blank lines and precedes each output line with its line
-e Displays a dollar sign ($) at the end of each output line.
-n Precedes all output lines (including blank lines) with line num‐
-s Squeezes adjacent blank lines from output and single spaces out‐
-t Displays non-printing characters (including tabs) in output. In
addition to those representations used with the -v option, all tab
characters are displayed as ^I.
-u Unbuffers output.
-v Displays non-printing characters (excluding tabs and newline) as
the ^x. If the character is in the range octal 0177 to octal
0241, it is displayed as M-x. The delete character (octal 0177)
displays as ^?. For example, is displayed as ^X.
Do not redirect output to one of the input files using the > (redirect‐
ion symbol). If you do this, you lose the original data in the input
file because the shell truncates it before can read it.
See Alsocp(1), ex(1), more(1), pr(1), tail(1)cat(1)