Viewing Files with cat, more, pg, head, and tail

To begin with, let's look at a long file. In fact, let's look at a file so long that it will not fit on your screen if you were to print out the contents of the file to your screen.

The cat command (short for concatenate) does just this; it prints out the file to your screen. If, however, the file is long, then you will only see the end of the file on your screen. Remember the user denise from earlier in the book? She had a lot of files in her directory. Let's list the files in her directory and redirect the output to a file called listing with the following command:

$ ls -a /home/denise > listing
					

When we cat listing to the screen, we see only the end of the file, as shown in Figure 22-1. We ...

Get HP-UX 11i System Administration Handbook and Toolkit, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.