In a previous example, the command cat was used to list a file on a terminal screen. A problem with cat is that the listing often flies by before you get a chance to read it. The programs view and more (or page pg) let you scroll through a file, one screenful at a time, and without the chance of changing it. The command more lets you step coarsely though a file (and on later versions step backwards as well). Both commands also do crude searches. The command view is a read-only version of the vi editor which actually uses vi for navigating through a file and performing searches. Its major drawback is that it cannot be used within a Unix pipe (we discuss pipes in a later section).
To use more or view to examine the file fname,
|% more fname||To see more than file's name.|
|% view fname||Read only vi editor.|
An abridged list of more subcommands is given below, while commands to use with view are found in Editing with vi. Most commands can be preceded by an integer argument to make them repeat. For example, [ret] moves down one line and 12[ret] moves down 12 lines.
d (^ d)
f (^ f)
b (^ b)
- REDRAW screen.
- Go to NEXT file.
- Go to PREVIOUS file.
- Show FILE name and line number.
- REPEAT previous command.