Forever & AlwaysLINUX COMMAND ATLAS

LINUX COMMAND ATLAS · COMMAND GUIDE

Linux cat command

Print file contents to the terminal or join multiple files together.

GNU Coreutils

Syntax

Command form
cat [OPTION]... [FILE]...

Common options

6 options
OptionWhat it does
-n, --numberNumber all output lines.
-b, --number-nonblankNumber nonblank output lines.
-s, --squeeze-blankSuppress repeated empty output lines.
-A, --show-allShow nonprinting characters, equivalent to -vET.
-E, --show-endsDisplay $ at the end of each line.
-T, --show-tabsDisplay tab characters as ^I.

Usage examples

3 examples

Print file contents to the terminal or join multiple files together.

cat ./config.ini

Write the contents of a text file to standard output.

cat README.md

Display a configuration file with line numbers.

cat -n config.conf

Notes

cat is best for short files or pipelines; use less to inspect large files interactively.