More and View



next up previous contents index
Next: Printing Files Up: ViewingEditing, and Previous: ViewingEditing, and

More and View

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, enter:

% 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.


COMMANDS FOR MORE
[space]
Forward one screen or number of lines given.
[ret]
Forward one line or number of lines given.
d (^ d)
Scroll forward 11 lines.
q (Q)
EXIT from more.
f (^ f)
Skip FORWARD by screenful of text.
b (^ b)
Skip BACKWARDS by screenful of text.
'
Go to place where previous search started.
=
Display current line number.
/pattern
SEARCH for ``pattern.''
n
Search for next occurrence of previous ``pattern.''
!cmd (:!cmd)
Execute cmd in a user's shell.
v
Start up vi editor at current line.
h
HELP!
^ l
REDRAW screen.
:n
Go to NEXT file.
:p
Go to PREVIOUS file.
:f
Show FILE name and line number.
.
REPEAT previous command.



next up previous contents index
Next: Printing Files Up: ViewingEditing, and Previous: ViewingEditing, and