10.2 Pagers: more, less, and most

10.2.1 more

more(1) is what we call a pager utility. Oftentimes the output of a particular command is too big to fit on one screen. The individual commands do not know how to fit their output to separate screens. They leave this job to the pager utility.

The more command breaks the output into individual screens and waits for you to press the space bar before continuing on to the next screen. Pressing the enter key will advance the output one line. Here is a good example:

% cd /usr/bin
% ls -l

That should scroll for a while. To break up the output screen by screen, just pipe it through more:

% ls -l | more

That is the pipe character (shift backslash). The pipe is short for saying take the output of ls and feed it into more. You can pipe just about anything through the more command, not just ls. Piping is also covered in Section 8.2.3.

10.2.2 less

The more command is quite handy, but often you will find that you have advanced past the screen you wanted. more does not provide a way to go back. The less(1) command provides this functionality. It is used in the same way as the more command, so the previous examples apply here too. So, less is more than more. Joost Kremers puts it this way:

less is more, but more more than more is, so more is less less, so use more less if you want less more.

10.2.3 most

Where more and less leave off, most(1) picks back up. If less is more than more, most is more than less. Whereas the other pagers can only display one file at a time, most is capable of viewing any number of files, as long as each file's window is at least 2 lines long. most has a lot of options, check the man page for full details.