Home Privacy Policy Feedback Link to us Site Map Forums

UNIX Basic commands: cat


The cat command reads one or more files and prints them to standard output. The operator > can be used to combine multiple files into one. The operator >> can be used to append to an existing file.

The syntax for the cat command is:

cat [options] [files]

options:

-e $ is printed at the end of each line. This option must be used with -v.
-s Suppress messages pertaining to files that do not exist.
-t Each tab will display as ^I and each form feed will display as ^L. This option must be used with -v.
-u Output is printed as unbuffered.
-v Display control characters and nonprinting characters

Examples:

cat file1
cat file1 file2 > all
cat file1 >> file2

* Please note that there are many flavors of UNIX, so if in doubt, consult your man pages.