Exploring cat - Linux Commands

| 4 min read

What is the cat Command in Linux?

The cat command stands for concatenate. It is used to read, concatenate, and write teh contents of files to the standard output (ususally the terminal)./ It is one of the most commonly used commands in Linux for viewing fule contents.

Basic syntax:

cat [option] [file]

Example:

cat file-name

Options

OptionDescription
-A, —show-allEquivalent to -vET, showing non-printing characters (except for spaces and tabs), end of lines, and tabs
-b, —number-nonblankNumber all non-empty output lines
-E, —show-endsDisplay a dollar sign $ at the end of each line
-n, —numberNumber all output lines
-s, —squeeze-blankSuppress repeated empty output lines
-T, —show-tabsDisplay TAB characters as ^I
-v, —show-nonprintingUse ^ and M- notation, except for LFD and TAB characters

Additional Help

You can explore more by using the commands:

cat --help
# or
man cat

Thank you!

Thank you for your time and for reading this!