Title: How do I page through the output of a Unix command?
Question:
When I use some Unix commands, the output scrolls off of the screen before
I can look at it. Is there a way to pause or page through the output?
Answer:
To force a Unix command to pause after displaying each page of output,
use the "more" command in a pipeline with your command. For example:
< command > | more
Here < command > is the Unix command that's producing the output you would
like to page through. As an example, suppose you have a directory listing
that is too long to fit on one screen. You would enter the following
command to pause after each page:
ls | more
After one page of output is displayed, the "more" program waits for you to
press the spacebar before displaying the next page. If you want to quit
out of the paging process, simply press the 'Q' key.
Another program that serves the same purpose is "less". Less has features
not included in "more" such as page up and page down.