cat - concatenate and print files


cat [-bensStuv] [file ...]


The cat(1) utility reads files sequentially, writing them to the standard output. The file operands are processed in command-line order. A single dash represents the standard input.

The options are as follows:

Like -n but does not number blank lines.
Like -v and displays a dollar sign ($) at the end of each line.
Number the output lines beginning at 1.
Do not display any error messages for unreadable or non-existant files.
Remove blank lines adjacent to another empty line, causing a single blank line to be output.
Like -v and also displays tab characters as ^I.
The -u option ensures that the output is unbuffered.
Displays non-printing characters so they are visible. Control characters print as ^X for control-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 defined by the lower seven bits.

Because of the shell language mechanism that is used to perform output redirection, the following command will cause the original data in file1 to be destroyed unless the shell is set for noclobber.

cat file1 file 2 > file1


The cat(1) utility exits with 0 on success, and >0 if an error occurs.