Linux and Unix cat command

Quick links

About cat
Related commands
Linux and Unix main page

About cat

cat stands for "catenate." It reads data from files, and outputs their contents. It is the simplest way to display the contents of a file at the command line.


cat [OPTION]... [FILE]...
-A, --show-all equivalent to -vET
-b, --number-nonblank number nonempty output lines; overrides -n
-e equivalent to -vE
-E, --show-ends display "$" at end of each line
-n, --number number all output lines
-s, --squeeze-blank suppress repeated empty output lines
-t equivalent to -vT
-T, --show-tabs display TAB characters as ^I
-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB
--help display a help message and exit
--version output version information and exit


cat file1.txt file2.txt

Reads and outputs the contents, in sequence, of file1.txt and file2.txt, respectively.

Related commands

ed — A simple text editor.
pico — A simple text editor.
tac — Output the contents of files in reverse order.
tee — Route a file's contents to multiple outputs.
touch — Update the timestamp of a file or directory.