Name
cat — stdin stdout - file -- opt --help --version
Synopsis
cat [options] [files]
The simplest viewer is cat,
which just prints its files to standard output, concatenating them
(hence the name). Large files will likely scroll off screen, so
consider using less if you plan
to read the output. That being said, cat is particularly useful for sending a
set of files into a shell pipeline:
$ cat * | wc
cat can also manipulate its
output in small ways, optionally displaying nonprinting characters,
prepending line numbers (though nl is more powerful for this purpose), and
eliminating whitespace.
Useful options
|
|
Print tabs as ^I. |
|
|
Print newlines as $. |
|
|
Print other nonprinting characters in a human-readable format. |
|
|
Prepend line numbers to every line. |
|
|
Prepend line numbers to nonblank lines. |
|
|
Squeeze each sequence of blank lines into a single blank line. |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access