Linux cat command in Example

cat – concatenate files and print on the standard output, is a standard Unix utility that reads files sequentially, writing them to standard output. The name is derived from its function to concatenate files.

Use

Example

View the content of a file

cat exploit.py

Add the content of textfile1 to the textfile2 file.

cat -n textfile1 > textfile2

Add the file contents of textfile1 and textfile2 to the line number (blank lines are not added) and append the contents to textfile3.

cat -b textfile1 textfile2 >> textfile3