cat
Concatenate and display file content
Overview
Displays the content of files, or concatenates files and prints on the standard output.
Syntax
cat [OPTION]... [FILE]...Common Options
-n, --numberNumber all output lines.
-b, --number-nonblankNumber nonempty output lines, overrides -n.
-s, --squeeze-blankSuppress repeated empty output lines.
-E, --show-endsDisplay $ at end of each line.
-T, --show-tabsDisplay TAB characters as ^I.
Examples
$ cat myfile.txt
Displays the content of myfile.txt.
$ cat file1.txt file2.txt
Displays the concatenated content of file1.txt and file2.txt.
$ cat file1.txt file2.txt > newfile.txt
Concatenates file1.txt and file2.txt and writes the output to newfile.txt.
$ cat -n script.sh
Displays the content of script.sh with line numbers.
$ cat /etc/os-release
Displays information about the operating system.
Related Commands
concatenatedisplayviewfilecontentcat