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 you type:
cat file
To concatenate two files and place the result on the third you type:
cat file1 file2 >file3
If no input file is given, or if an en dash (−) is encountered as an argument, 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. The cat utility supports the processing of 8-bit characters.
OPTIONS
−b Ignores blank lines and precedes each output line with its line number.
−e Displays a dollar sign ($) at the end of each output line.
−n Precedes all output lines (including blank lines) with line numbers.
−s Squeezes adjacent blank lines from output and single spaces output.
−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). For example, <CTRLX> displays on the screen as ^X. The delete character (octal 0177) displays as ^?. Non-ascii characters (with the high bit set) display as M- (which is the meta character) followed by the low 7 bits.
RESTRICTIONS
The following examples destroy the input files before reading them:
cat file1 file2 >file1
cat file1 file2 >file2