O'Reilly logo

Linux® Desk Reference, Second Edition by Scott Hawkins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Commands

cat

[OPTION] [FILE]…

Copies the specified file (or standard input) to standard output.

Example: To display the contents of the file /etc/passwd to standard output, use

cat /etc/passwd

To send the contents of a file to some other program as input, cat is frequently used on the left side of a pipe:

cat database.dat | sort -rn

-A, --show-all This option is equivalent to “-vET”.
-b, --number-nonblank Use this option to include line numbers for output (nonblank lines only) and to number all nonblank output lines, starting with 1.
-e This option is equivalent to “-vE”.
-E, --show-ends Use this option to display a “$” after the end of each ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required