The more utility is light-years ahead of . It lets you read files one page at a time. If you had only cat and wanted to read long files, you'd have to read very fast or have a quick trigger finger (on ) to stop the text - or get used to reading the last few lines of a file, and no more. In fact, even the most backward versions of more are infinitely preferable to cat for reading a file - so much so that I don't understand why anyone uses cat for this purpose. [I cat tiny files because I have more and set up to clear my screen (with the -c option) before displaying a file. -TC ]
When you start more, it displays the first screen of the file.
To move to the next page, press the space bar. You can continue to move
forward through the file by pressing the space bar or by pressing RETURN
(which moves you forward one line). More recent versions of
more allow you to "back up" to previous pages in the file by
Some other features:
If you list several files on the command line, you can type
move to the next file and
:p to move to the previous one.
You can get a "help" screen at any time by typing
You can jump from more into the vi editor by typing
You can search for a string by typing
/, followed by the string
you want. The search string can be a full
You can find the next occurrence of a string by typing
If you invoke more with two or more files, it will display a short header at the beginning of each file. This little nicety is strangely useful. Let's say you want to print all of your .h files with a single command, and you'd like some kind of label before each file. You canfor you:
(When more isn't writing to a terminal, it doesn't expect you to type anything; it dumps all files to standard output.)
more has a few defects:
Even the best versions can't back up while reading a
pipe. So if you pipe the output from some command into more,
b won't work.
When you get to the end of the last file, more quits. I guess there's nothing wrong with this behavior, but I don't like it; I'd rather have the chance to back up or move to an earlier file.
Some implementations of more (System V) terminate if you search for a string that it can't find.
[Some versions of System V support a somewhat equivalent program
called pg instead of more.
And some people like to look
at files with a read-only version of vi called view.
I prefer more or less.
:-) -TOR ]