Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

cat(1) OSS Shell and Utilities Reference Manual
NAME
cat - Concatenates or displays les
SYNOPSIS
cat [-benrstuv][- | le] ...
The cat command reads each specied le in sequence and writes it to standard output.
FLAGS
-b Omits line numbers from blank lines when -n is specied. If you specify the -b ag,
the -n ag is automatically invoked with it.
-e Same as the -v ag with a $ (dollar sign) character displayed at the end of each line.
-n Displays output lines preceded by line numbers, numbered sequentially from 1.
-r Replaces multiple consecutive empty lines with one empty line, so there is never more
than one empty line between lines containing characters.
-s Does not display a message if cat cannot nd an input le. (Silent option.)
-t Same as the -v ag, with the tab character printed as <Ctrl-i> (ˆI).
-u Does not buffer output. Writes bytes from the input le to standard output without
delay as each is read.
-v Displays nonprinting characters so they are visible.
DESCRIPTION
The cat command is frequently used with > (redirection symbol) to concatenate the specied
les and write them to the specied destination. (See CAUTIONS.) cat is also used with >> to
append a le to another le.
If you do not specify a le or if you specify - (dash) instead of le, cat reads from standard input.
The cat command accepts multiple occurrences of - (dash) as a le argument.
EXAMPLES
1. To display the le notes,enter:
cat notes
If the le is longer than one screenful, it scrolls by too quickly to read. To display a le
one page at a time, use the more command.
2. To concatenate several les, enter:
cat section1.1 section1.2 section1.3 > section1
This creates a le named section1 that is a copy of section1.1 followed by section1.2
and section1.3.
3. To suppress error messages about les that do not exist, enter:
cat -s section2.1 section2.2 section2.3 > section2
If section2.1 does not exist, this command concatenates section2.2 and section2.3. Note
that the message goes to standard error, so it does not appear in the output le. The
result is the same if you do not use the -s ag except that cat displays the error message:
cat: cannot open section2.1
You may want to suppress this message with the -s ag when you use the cat command
in shell procedures.
236 Hewlett-Packard Company 527188-007