Linux and Unix cat command

Quick links

About cat
Syntax
Examples
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.

Syntax

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

Examples

cat file1.txt file2.txt

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

Related commands

ed
pico
tac
tee
touch