Cat command with examples

Cat command with examples

Cat command is one of the most widely used text editor in linux. Using cat command you can view, modify and delete content of files.

 

cat command with examples

 

To view the content of a file

#cat file.txt

To create a file and to add content to it

#cat > linux
This file name is linux

To save the file linux press “Ctrl + Shift + D”

To append entry in file linux

#cat >> linux
I am appending entry in file linux

 

cat command in linux

 

To view content of file with line number

#cat -n /etc/passwd

To view content of file with line number and exclude blank space

#cat -b file.txt
cat_command1

 




Leave a Reply

Your email address will not be published. Required fields are marked *