O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

cat

Format:

Cat options files 

Option:

-v to display control characters.

Cat is the most used file pager for text files.

					$ cat myfile
				

Display the file myfile

					$ cat myfile myfile2 >>hold_file
				

The above will combine two files (myfile and myfile2) into one file called hold_file.

					cat dt1 | while read line 
do 
  echo $line 
done
				

Cat is also used to read files in your scripts.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required