Hiko provided the short answer. The long answer goes like this:
When the man
program displays a manual page, it sends the output through a pager program. The job of the pager program is to print the output. The simplest pager program could just print the whole manual page without waiting... this would scroll off the top of the terminal very quickly.
These days terminal emulator programs can scroll up to see what has gone "off the top of the screen", but in the past this wasn't always the case - not when a terminal was one of these
. To make life easier, the man program will check to see if the PAGER environment variable is set, and if it is, it will send the manual page output to this program to view. A simple pager is the more
program, which just prints to the terminal what it gets as input. However, if it has printed a whole screen's worth of output, it waits for the user to press a key before it continues. This behaviour is presumably where the name pager comes from - displaying one page at a time.
As terminals got more sophisticated, features such as being able scroll back
became feasible. A common pager program used in many Linux distributions is less
. The name is a play on the name more. less has many nice features, like being able to search the input file for strings and regular expression patterns. There's a whole bunch of features in there. To see what they are, you should read the less manual page.
The most basic keys are:
- Up and down cursors for scrolling one line at a time
- Space to move forward a whole page
- q to quit
- / to search for a regular expression pattern
- n to repeat the last search