cat(1)
NAME
cat − concatenate and print data
SYNTAX
cat [−b] [−e] [−n] [−s] [−t] [−u] [−v] file...
DESCRIPTION
The cat command reads each file in sequence and displays it on the standard output. Therefore to display the file on the standard output:
cat file
To concatenate the first two files and places the result on the third:
cat file1 file2 >file3
If no input file is given, or if the argument ‘−’ is encountered, cat 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.
OPTIONS
−bIgnores blank lines and precedes each output line with its line number.
−eDisplays dollar sign ($) at the end of each output line.
−nPrecedes all output lines (including blank lines) with line numbers.
−sSqueezes adjacent blank lines from output: single spaces output.
−tDisplays non-printing characters (including tabs) in output. In addition to those representations used with the −v option, all tab characters are displayed as ^I.
−uUnbuffers output.
−vDisplays non-printing characters (excluding tabs). <CTRLx> (control character x) prints as ^X. The delete character (octal 0177) prints as ^?. Non-ascii characters (with the high bit set) are printed as M- (for meta) followed by the character of the low 7 bits.
RESTRICTIONS
Beware of ‘cat a b >a’ and ‘cat a b >b’, which destroy the input files before reading them.