MORE(1) COMMAND REFERENCE MORE(1)
NAME
more, page - file perusal filter for crt viewing
SYNOPSIS
more [ -c ] [ -d ] [ -f ] [ -l ] [ -p ] [ -s ] [ -u ] [ -n ]
[ +linenumber ] [ +/pattern ] [ filename... ]
DESCRIPTION
More is a filter which allows examination of a continuous
text one screenful at a time on a soft-copy terminal. It
normally pauses after each screenful, printing "--More--" at
the bottom of the screen. If the user then types a carriage
return, one more line is displayed. If the user hits a
space, another screenful is displayed. Other possibilities
are enumerated later.
If the program is invoked as page, or with the -p option,
then the screen is cleared before each screenful is printed
(but only if a full screenful is being printed), and k - 1
rather than k - 2 lines are printed in each screenful, where
k is the number of lines the terminal can display.
More looks in the termcap entry (see TERMCAP in the
VARIABLES section) to determine terminal characteristics,
and to determine the default window size. On a terminal
capable of displaying 24 lines, the default window size is
22 lines.
More looks in the environment variable MORE to pre-set any
flags desired. For example, if you prefer to view files
using the -c mode of operation, the sh command sequence
MORE='-c' ; export MORE would cause all invocations of more
, including invocations by programs such as man and msgs ,
to use this mode. The MORE environment variable is only
checked for flags, so the preceding - is not required.
Normally, the user will place the command sequence which
sets up the MORE environment variable in the .profile file.
If more is reading from a file, rather than a pipe, then a
percentage is displayed along with the --More-- prompt.
This gives the fraction of the file (in characters, not
lines) that has been read so far.
Other sequences which may be typed when more pauses, and
their effects, are as follows (i is an optional integer
argument, defaulting to 1) :
i<space>
display i more lines, (or another screenful if no
argument is given)
Printed 10/17/86 1
MORE(1) COMMAND REFERENCE MORE(1)
i<cr>
display i more lines, (or one line if no argument is
given). The value of i becomes the new window size.
^D display 11 more lines (a ``scroll''). If i is given,
then the scroll size is set to i.
d same as ^D (control-D)
iz same as typing a space except that i, if present,
becomes the new window size.
is skip i lines and print a screenful of lines
if skip i screenfuls and print a screenful of lines
q or Q
Exit from more.
= Display the current line number.
v Start up the editor vi at the current line.
h or ?
Help command; give a description of all the more
commands.
i/expr
search for the i-th occurrence of the regular
expression expr. If there are less than i occurrences
of expr, and the input is a file (rather than a pipe),
then the position in the file remains unchanged.
Otherwise, a screenful is displayed, starting two lines
before the place where the expression was found. The
user's erase and kill characters may be used to edit
the regular expression. Erasing back past the first
column cancels the search command.
in search for the i-th occurrence of the last regular
expression entered.
' (single quote) Go to the point from which the last
search started. If no search has been performed in the
current file, this command goes back to the beginning
of the file.
!command
invoke a shell with command. The characters `%' and
`!' in "command" are replaced with the current file
name and the previous shell command respectively. If
there is no current file name, `%' is not expanded.
The sequences "\%" and "\!" are replaced by "%" and "!"
Printed 10/17/86 2
MORE(1) COMMAND REFERENCE MORE(1)
respectively.
i:n skip to the i-th next file given in the command line
(skips to last file if i doesn't make sense)
i:p skip to the i-th previous file given in the command
line. If this command is given in the middle of
printing out a file, then more goes back to the
beginning of the file. If i doesn't make sense, more
skips back to the first file. If more is not reading
from a file, the bell is rung and nothing else happens.
:f display the current file name and line number.
:q or :Q
exit from more (same as q or Q).
. (dot) repeat the previous command.
The commands take effect immediately, i.e., it is not
necessary to type a carriage return. Up to the time when
the command character itself is given, the user may hit the
line kill character to cancel the numerical argument being
formed. In addition, the user may hit the erase character
to redisplay the --More--(xx%) message.
At any time when output is being sent to the terminal, the
user can hit the quit key (normally control-\). More will
stop sending output, and will display the usual --More--
prompt. The user may then enter one of the above commands
in the normal manner. Unfortunately, some output is lost
when this is done, due to the fact that any characters
waiting in the terminal's output queue are flushed when the
quit signal occurs.
The terminal is set to noecho mode (see stty(1) ) by this
program so that the output can be continuous. What you type
will thus not show on your terminal, except for the / and !
commands.
If the standard output is not a teletype, then more acts
just like cat, except that a header is printed before each
file (if there is more than one).
A sample usage of more in previewing nroff output would be
nroff -ms +2 doc.n | more -s
OPTIONS
-c More will draw each page by beginning at the top of the
screen and erasing each line just before it draws on it.
This avoids scrolling the screen, making it easier to
Printed 10/17/86 3
MORE(1) COMMAND REFERENCE MORE(1)
read while more is writing. This option will be ignored
if the terminal does not have the ability to clear to
the end of a line.
-d More will prompt the user with the message "Hit space to
continue, Q or q to quit" at the end of each screenful.
This is useful if more is being used as a filter in some
setting, such as a class, where many users may be
unsophisticated.
-f This causes more to count logical, rather than screen
lines. That is, long lines are not folded. This option
is recommended if nroff output is being piped through
ul, since the latter may generate escape sequences.
These escape sequences contain characters which would
ordinarily occupy screen positions, but which do not
print when they are sent to the terminal as part of an
escape sequence. Thus more may think that lines are
longer than they actually are, and fold lines
erroneously.
-l Do not treat ^L (form feed) specially. If this option
is not given, more will pause after any line that
contains a ^L, as if the end of a screenful had been
reached. Also, if a file begins with a form feed, the
screen will be cleared before the file is printed.
-n An integer which is the size (in lines) of the window
which more will use instead of the default.
-p More will erase the entire screen before displaying the
next page. This is the same as executing page.
-s Squeeze multiple empty lines from the output, producing
only one empty line (lines with whitespace are not
empty). Especially helpful when viewing nroff output,
this option maximizes the useful information present on
the screen.
-u Normally, more will handle underlining and bold
characters such as produced by nroff in a manner
appropriate to the particular terminal: if the terminal
can perform underlining or has a stand-out mode, more
will output appropriate escape sequences to enable
underlining, bold or stand-out mode for underlined
information in the source file. The -u option suppresses
this processing.
+linenumber
Start up at linenumber.
+/pattern
Printed 10/17/86 4
MORE(1) COMMAND REFERENCE MORE(1)
Start up three lines before the line containing the
regular expression pattern.
EXAMPLES
The following example will display the file text.c starting
at line 65.
more +65 text.c
FILES
/etc/termcap Default terminal data base.
/usr/lib/more.help Help file.
VARIABLES
MORE The options to be used when invoking more.
SHELL The user's login shell. Used for shell
escapes.
TERM The type of terminal being used.
TERMCAP The name of the file containing the terminal
capability entry, or the entry itself.
RETURN VALUE
[NO_ERRS] Command completed without error.
[USAGE] Incorrect command line syntax. Execution
terminated.
[NP_WARN] An error warranting a warning message
occurred. Execution continues.
[P_WARN] A system error occurred. Execution continues.
See intro(2) for more information on system
errors.
[P_ERR] A system error occurred. Execution
terminated. See intro(2) for more
information on system errors.
CAVEATS
If no ho string exists in the termcap entry, cursor motion
is used to home the cursor when the -c or -p options are
used. In these cases, the ti string is printed before text
is displayed, and the te string is printed before more
exits. The manual page for termcap(5t) describes ti and te
as the strings required to enter/exit programs that use
Printed 10/17/86 5
MORE(1) COMMAND REFERENCE MORE(1)
cursor motion. This means that te should not clear the
screen! If it does, your screen will be cleared when you
exit more.
Lines longer than 1024 characters are separated into 1024
character lines separated by newlines. The 1024 character
limit applies to input characters, so a line that contains a
large number of backspaces may be separated even if it
prints as less than 1024 characters.
When more is run on files that are being written or
appended, the percentage of the file viewed may be listed as
more than 100%.
Numbers in the options are scanned sequentially and do not
get reset. For example, the commands
more -1f1
more -11f
are equivalent.
When a line contains a pagefeed (^L), the entire line is
displayed at the end of the page, instead of being split up.
SEE ALSO
man(1man), nroff(1), page(1), sh(1sh), stty(1), ul(1),
termcap(5t), environ(7).
Printed 10/17/86 6
%%index%%
na:72,84;
sy:156,360;
de:516,2416;3076,2056;5276,2205;
op:7481,280;7905,2828;10877,113;
ex:10990,170;
fi:11160,185;
va:11345,396;
rv:11741,681;
ca:12422,511;13077,939;
se:14016,260;
%%index%%000000000215