CAT(1) User Commands CAT(1)

cat - concatenate and print files

cat [-suv [-et]] [-B size] [file ...]

Cat reads each file in sequence and writes it on the standard output. Thus

cat file

prints the file and

cat file1 file2 >file3

concatenates the first two files and places the result on the third.

If no file is given, or if the argument `-' is encountered, cat reads from the standard input.

The cat command accepts the following options:

Ensures output to be unbuffered.
Causes cat to be silent about files that cannot be opened, read problems and similar error conditions.
With this option given, non-printable characters are detected and printed as `^n' for control characters and `M-n' for characters with the high bit set.
If -v is present, this option causes tab and formfeed characters to be handled as control characters.
If -v is present, this option causes end-of-line to be marked with `$'.

The following option is an extension:

Causes input and output to be performed in size byte units.

See locale(7).
Determines the mapping of bytes to characters and the set of printable characters for the -v option.

cp(1), pg(1), pr(1), locale(7)

Beware of `cat a b >a' and `cat a b >b', which destroy input files before reading them.

4/17/05 Heirloom Toolchest