Table of content

Cat command in Linux

When cat command is used inside pipes it filters the input data and does not shows the content of the file.

Syntax :

cat filename | grep <word/character>

Example :

cat f1 f2 | grep Hi

From the files named f1 and f2 grep the word "Hi". The grepped word is highlighted in red colour in the output.
cat-grep-linux

You can combine two files and creates a new file

cat filename1 filename2 > filename

cat-command3-linux

How To Append Data To A Text File

To append (add data to existing) data to a file give the below command

cat >>filename

press ctri+c to exit the wizard after typing the content

cat-append-command-linux

To display TAB characters as ^I give the below command

cat -T filename

cat-t-command-linux

To display $ at end of each line give the below command,

cat -E filename
OR
cat --show-ends filename

cat-show-ends-command-linux

To show all the functions give the below command,

cat -A fileName
OR
cat -vET fileName

cat-a-command-linux
cat-vet-command-linux

0 results
Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions