Viewing File Contents
As an administrator, you may often need to view the contents of a log file. The cat} and less} commands are most useful for this. Use cat to display the contents of one or more files.
cat file1 file2 …
Often, the file may have more lines than can be displayed in a page. In such a case, only the last page appears on the screen. To view the previous pages, press <Shift> + <page up>. Alternately, you may use the less command, which displays the contents of the file page by page as follows:
less file1
This command shows the file1 one page at a time. Use f to view the next page. <Page Down> may work too, but not necessarily. Use b to go back to the previous page. You may find it easy to remember these navigation keys as forward (f) and back (b).