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

5.3. cat

cat is a very simple but versatile file display and file creator which is also handy for displaying control characters. When using cat be warned that it will not pause between page breaks; it literally displays the whole file in one go. If you need to see a file a page at a time then use ‘more’ or pipe the output from cat through to another pager, like this:

						$ cat myfile | more
					

or

						$ cat myfile | pg
					

The general format is:

cat [options] filename1...filename2... 

cat ’s most useful option is:

-v Display control characters.

To display a file called myfile:

						$ cat myfile
					

To display three files called myfile1, myfile2 and myfile3:

						$ cat myfile1 myfile2 myfile3
					

To create a file called bigfile that contains the contents of the files ...

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