Manual page for cat(1)
cat - concatenate and display files
and writes it on the standard output.
example% cat file
on your terminal, and:
example% cat file1 file2 >file3
and writes the results in
If no input file is given,
reads from the standard
Precede each line output with its line number.
Number the lines, as
but omit the line numbers from blank lines.
The output is not buffered.
(The default is buffered output.)
is silent about non-existent files.
(with the exception of tabs, new-lines
are printed visibly.
control characters (octal 000 - 037) are printed as
is the corresponding
character in the range octal 100 - 137
(@, A, B, C, . . ., X, Y, Z, [, \, ], ^, and _);
character (octal 0177) is printed
Other non-printable characters are printed
character specified by the low-order seven bits.
When used with the
the following options may be used:
character will be printed at the end of each line
(prior to the new-line).
Tabs will be printed as
and formfeeds to be printed as
options are ignored if the
option is not specified.
The following operand is supported:
A path name of an input file.
the standard input is used.
will read from the standard input at that point in the sequence.
will not close and reopen standard input when
it is referenced in this way, but will accept multiple occurrences of
The following command:
example% cat myfile
writes the contents of the file
to standard output.
The following command:
example% cat doc1 doc2 > doc.all
concatenates the files
and writes the result to
example% cat start - middle - end > file
when standard input is a terminal, gets two arbitrary pieces of
input from the terminal with a single invocation of
Note, however, that if standard input is a regular file, this would be
equivalent to the command:
cat start - middle /dev/null end > file
because the entire contents of the file would be consumed by
the first time
was used as a
operand and an end-of-file
condition would be detected immediately when
was referenced the second time.
for descriptions of the following environment variables that affect
the execution of
The following exit values are returned:
All input files were output successfully.
An error occurred.
Redirecting the output of
onto one of the files being read will cause
the loss of the data originally in the file being read.
example% cat filename1 filename2 >filename1
causes the original data in
to be lost.
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97