more(1) more(1)
NAME [Toc] [Back]
more, page - file perusal filter for crt viewing
SYNOPSIS [Toc] [Back]
more [-n] [-cdefisuvz] [-n number] [-p command] [-t tagstring] [-x
tabs] [-W option] [+linenumber] [+/pattern] [name ...]
page [-n] [-cdefisuvz] [-n number] [-p command] [-t tagstring] [-x
tabs] [-W option] [+linenumber] [+/pattern] [name ...]
REMARKS:
pg is preferred in some standards and has some added functionality, but
does not support character highlighting (see pg(1)).
DESCRIPTION [Toc] [Back]
more is a filter for examining continuous text, one screenful at a
time, on a soft-copy terminal. It is quite similar to pg, and is
retained primarily for backward compatibility. more normally pauses
after each screenful, printing the filename at the bottom of the
screen. To display one more line, press <Return>. To display another
screenful press <Space>. Other possibilities are described later.
more and page differ only slightly. more scrolls the screen upward as
it prints the next page. page clears the screen and prints a new
screenful of text when it prints a new page. Both provide one line of
overlap between screenfuls.
name can be a filename or -, specifying standard input. more
processes file arguments in the order given.
more supports the Basic Regular Expression syntax (see regexp(5)).
more recognizes the following command line options:
-n number Set the number of lines in the display window to
number, a positive decimal integer. The default
is one line less than the the number of lines
displayed by the terminal; on a screen that
displays 24 lines, the default is 23. The -n flag
overrides any values obtained from the
environment.
-n Same as -n number except that the number of lines
is set to n.
-c Draw each page by beginning at the top of the
screen, and erase each line just before drawing on
it. This avoids scrolling the screen, making it
easier to read while more is writing. This option
is ignored if the terminal has no clear-to-endof-line
capability.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
more(1) more(1)
-d Prompt user with the message Press space to
continue, q to quit, h for help at the end of each
screenful. This is useful if more is being used
as a filter in some setting, such as a training
class, where many users might be unsophisticated.
-e Exit immediately after writing the last line of
the last file in the argument list
-f Count logical lines, 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 can generate escape
sequences. These escape sequences contain
characters that would ordinarily occupy screen
positions, but which do not print when sent to the
terminal as part of an escape sequence. Thus more
might assume lines are longer than they really
are, and fold lines erroneously.
-i Perform pattern matching in searches without
regard to case.
-s Squeeze multiple blank lines from the output,
producing only one blank line. Especially helpful
when viewing nroff output, this option maximizes
the useful information present on the screen.
-u Normally, more handles underlining and bold such
as produced by nroff in a manner appropriate to
the particular terminal: if the terminal supports
underlining or has a highlighting (usually
inverse-video) mode, more outputs appropriate
escape sequences to enable underlining, else
highlighting mode, for underlined information in
the source file. If the terminal supports
highlighting, more uses that mode information that
should be printed in boldface type. The -u option
suppresses this processing, as do the "ul" and
"os" terminfo flags.
-v Do not display nonprinting characters graphically;
by default, all non-ASCII and control characters
(except <Tab>, <Backspace>, and <Return>) are
displayed visibly in the form ^X for <Ctrl-x>, or
M-x for non-ASCII character x.
-z Same as not specifying -v, with the exception of
displaying <Backspace> as ^H, <Return> as ^M, and
<Tab> as ^I.
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
more(1) more(1)
-p command Execute the more command initially in the command
argument for each file examined. If the command
is a positioning command, such as a line number or
a regular expression search, sets the current
position to represent the final results of the
command, without writing any intermediate lines of
the file. If the positioning command is
unsuccessful, the first line in the file is the
current position.
-t tagstring Write the screenful of the file containing the tag
named by the tagstring argument. The specified
tag appears in the current position. If both -p
and -t options are specified, more processes -t
first; that is, the file containing the tagstring
is selected by -t and then the command is
executed.
-x tabs Set the tabstops every tabs position. The default
value for the tabs argument is 8.
-W option Provides optional extensions to the more command.
Currently, the following two options are
supported:
notite Prevents more from sending the
terminal initialization string
before displaying the file.
This argument also prevents
more from sending the terminal
de-initialization string
before exiting.
tite Causes more to send the
initialization and deinitialization
strings. This
is the default.
+linenumber Start listing such that the current position is
set to linenumber.
+/pattern Start listing such that the current position is
set to two lines above the line matching the
regular expression pattern.
Note: Unlike editors, this construct should NOT
end with a /. If it does, the trailing slash is
taken as character in the search pattern.
The number of lines available per screen is determined by the -n
option, if present or by examining values in the environment. The
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: August 2003
more(1) more(1)
actual number of lines written is one less than this number, as the
last line of the screen is used to write a user prompt and user input.
The number of columns available per line is determined by examining
values in the environment. more writes lines containing more
characters than would fit into this number of columns by breaking the
line into one more logical lines where each of these lines but the
last contains the number of characters needed to fill the columns.
The logical lines are written independently of each other; that is,
commands affecting a single line affect them separately.
While determining the number of lines and the number of columns, if
the methods described above do not yield any number then more uses
terminfo descriptor files (see term(4)). If this also fails then the
number of lines is set to 24 and the number of columns to 80.
When standard output is a terminal and -u is not specified, more
treats backspace characters and carriage-return characters specially.
+ A character, followed first by a backspace character, then by
an underscore (_), causes that character to be written as
underlined text, if the terminal supports that. An underscore,
followed first by a backspace character, then any character,
also causes that character to be written as underlined text,
if the terminal supports that.
+ A backspace character that appears between two identical
printable characters causes the first of those two characters
to be written as emboldened text, if the terminal type
supports that, and the second to be discarded. Immediately
subsequent occurrences of backspaces/character pairs for that
same character is also discarded.
+ Other backspace character sequences is written directly to the
terminal, which generally causes the character preceding the
backspace character to be suppressed in the display.
+ A carriage-return character at the end of a line is ignored,
rather than being written as a control character.
If the standard output is not a terminal device, more always exits
when it reaches end-of-file on the last file in its argument list.
Otherwise, for all files but the last, more prompts, with an
indication that it has reached the end of file, along with the name of
the next file. For the last file specified, or for the standard input
if no file is specified, more prompts, indicating end-fo-file, and
accept additional commands. If the next command specifies forward
scrolling, more will exit. If the -e option is specified, more will
exit immediately after writing the last line of the last file.
Hewlett-Packard Company - 4 - HP-UX 11i Version 2: August 2003
more(1) more(1)
more uses the environment variable MORE to preset any flags desired.
The MORE variable thus sets a string containing flags and arguments,
preceded with hyphens and blank-character-separated as on the command
line. Any command-line flags or arguments are processed after those in
the MORE variable, as if the command line were as follows:
more $MORE flags arguments
For example, to view files using the -c mode of operation, the shell
command sequence
MORE='-c' ; export MORE
or the csh command
setenv MORE -c
causes all invocations of more, including invocations by programs such
as man and msgs, to use this mode. The command sequence that sets up
the MORE environment variable is usually placed in the .profile or
.cshrc file.
In the following descriptions, the current position refers to two
things:
+ the position of the current line on the screen
+ the line number (in the file) of the current line on the
screen
The line on the screen corresponding to the current position is the
third line on the screen. If this is not possible (there are fewer
than three lines to display or this is the first page of the file, or
it is the last page of the file), then the current position is either
the first or last line on the screen.
Other sequences that can be typed when more pauses, and their effects,
are as follows (i is an optional integer argument, defaulting to 1):
i<Return>
ij
i<Ctrl-e>
i<Space> Scroll forward i lines. The default i for <Space>
is one screenful; for j and <Return> it is one
line. The entire i lines are written, even if i is
more than the screen size. At end-of-file,
<Return> causes more to continue with the next
file in the list, or exits if the current file is
the last file in the list.
Hewlett-Packard Company - 5 - HP-UX 11i Version 2: August 2003
more(1) more(1)
id
i<Ctrl-d> Scroll forward i lines, with a default of one half
of the screen size. If i is specified, it becomes
the new default for subsequent d and u commands.
iu
i<Ctrl-u> Scrolls backward i lines, with a default of one
half of the screen size. If i is specified, it
becomes the new default for subsequent d and u
commands.
ik
i<Ctrl-y> Scrolls backward i lines, with a default of one
line. The entire i lines are written, even if i is
more than the screen size.
iz Display i more lines and sets the new window
(screenful) size to i .
ig Go to line i in the file, with a default of 1
(beginning of file). Scroll or rewrite the screen
so that the line is at the current position. If i
is not specified, then more displays the first
screenful in the file.
iG Go to line i in the file, with a default of the
end of the file. If i is not specified, scrolls or
rewrites screen so that the last line in the file
is at the bottom of the screen. If i is specified,
scrolls or rewrites the screen so that the line is
at the current position.
is Skip forward i lines, with a default of 1, and
write the next screenful beginning at that point.
If i would cause the current position to be such
that less than one screenful would be written, the
last screenful in the file is written.
if
i<Ctrl-f> Move forward i lines, with a default of one
screenful. At end-of-file, more will continue with
the next file in the list, or exit if the current
file is the last file in the list.
ib
i<Ctrl-b> Move backward i lines, with a default of one
screenful. If i is more than the screen size, only
the final screenful will be written.
q
Hewlett-Packard Company - 6 - HP-UX 11i Version 2: August 2003
more(1) more(1)
Q
:q
:Q
ZZ Exit from more.
=
:f
<Ctrl-g> Write the name of the file currently being
examined, the number relative to the total number
of files there are to examine, the current line
number, the current byte number, and the total
bytes to write and what percentage of the file
precedes the current position. All of these items
reference the first byte of the line after the
last line written.
v Invoke an editor to edit the current file being
examined. The name of the editor is taken from the
environment variable EDITOR, or default to vi. If
EDITOR represents either vi or ex, the editor is
invoked with options such that the current editor
line is the physical line corresponding to the
current position in more at the time of the
invocation.
When the editor exits, more resumes on the current
file by rewriting the screen with the current line
as the current position.
h Display a description of all the more commands.
i/[!]expression
Search forward in the file for the i-th line
containing the regular expression expression. The
default value for i is 1. The search starts at the
line following the current position. If the
search is successful, the screen is modified so
that the searched-for line is in the current
position. The null regular expression (/<Return>)
repeats the search using the previous regular
expression. If the character ! is included, the
lines for searching are those that do not contain
expression.
If there are less than i occurrences of
expression, and the input is a file rather than a
pipe, then the position in the file remains
unchanged.
The user's erase and kill characters can be used
to edit the regular expression. Erasing back past
Hewlett-Packard Company - 7 - HP-UX 11i Version 2: August 2003
more(1) more(1)
the first column cancels the search command.
i?[!]expression
Same as /, but searches backward in the file for
the i th line containing the regular expression
expression.
Note: Unlike editors, the ?. construct should NOT
end with a /. If it does, the trailing slash is
taken as a character in the search pattern.
in Repeat the previous search for the i-th line
(default 1) containing the last expression (or not
containing the last expression, if the previous
search was /! or ?!).
iN Repeat the search for the opposite direction of
the previous search for the i-th line (default 1)
containing the last expression
'' (2 apostrophes) Return to the position from which
the last large movement command was executed
("large movement" is defined as any movement of
more than a screenful of lines). If no such
movements have been made, return 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 ! respectively.
:e [file]
E [file] Examine a new file. If the file argument is not
specified, the "current" file (see the :n and :p
commands) from the list of files in the command
line is re-examined. The filename is subjected to
the process of shell word expansions. If file is
a # (number sign) character, the previously
examined file is re-examined.
i:n Examine the next file. If i is specified, examines
the i-th next file specified in the command line.
i:p Examine the previous file. If a number i is
specified, examines the i-th previous file
specified in the command line.
Hewlett-Packard Company - 8 - HP-UX 11i Version 2: August 2003
more(1) more(1)
:t tagstring Go to the supplied tagstring and scroll or rewrite
the screen with that line in the current position.
m letter Mark the current position with the specified
letter, where letter represents the name of one of
the lower-case letters of the portable character
set.
' letter Return to the position that was previously marked
with the specified letter, making that line the
current position.
r
<Ctrl-l> Refresh the screen.
R Refresh the screen, discarding any buffered input.
. Dot. Repeat the previous command.
^\ Halt a partial display of text. more stops
sending output, and displays the usual prompt.
Unfortunately, some output is lost as a result.
The commands take effect immediately; i.e., it is not necessary to
press <Return>. Up to the time when the command character itself is
given, the line-kill character can be used to cancel the numerical
argument being formed.
If the standard output is not a teletype, more is equivalent to
cat(1).
more supports the SIGWINCH signal, and redraws the screen in response
to window size changes.
EXTERNAL INFLUENCES [Toc] [Back]
Environment Variables
COLUMNS Overrides the system-selected horizontal screen size.
EDITOR Used by the v command to select an editor.
LANG Provides a default value for the internationalization
variables that are unset or null. If LANG is unset or
null, the default value of "C" (see lang(5)) is used.
If any of the internationalization variables contains
an invalid setting, more will behave as if all
internationalization variables are set to "C". See
environ(5).
LC_ALL If set to a non-empty string value, overrides the
values of all the other internationalization variables.
Hewlett-Packard Company - 9 - HP-UX 11i Version 2: August 2003
more(1) more(1)
LC_CTYPE Determines the interpretation of text as single and/or
multi-byte characters, the classification of characters
as printable, and the characters matched by character
class expressions in regular expressions.
LC_MESSAGES Determines the locale that should be used to affect the
format and contents of diagnostic messages written to
standard error and informative messages written to
standard output.
NLSPATH Determines the location of message catalogues for the
processing of LC_MESSAGES.
LINES Overrides the system-selected vertical screen size,
used as the number of lines in a screenful. The -n
option takes precedence over the LINES variable for
determining the number of lines in a screenful.
MORE Determines a string containing options, preceded with
hyphens and blank-character-separated as on the command
line. Any command-line options are processed after
those in the MORE variable. The MORE variable takes
precedence over the TERM and LINES variables for
determining the number of lines in a screenful.
TERM Determines the name of the terminal type.
International Code Set Support [Toc] [Back]
Single- and multi-byte character code sets are supported.
APPLICATION USAGE [Toc] [Back]
When the standard output is not a terminal, none of the filtermodification
options is effective. This is based on historical
practice. For example, a typical implementation of man pipes its
output through more -s to squeeze excess white space for terminal
users. When man is piped to lp, however, it is undesirable for this
squeezing to happen.
EXAMPLES [Toc] [Back]
To view a simple file, use:
more filename
To preview nroff output, use a command resembling:
nroff -mm +2 doc.n | more -s
If the file contains tables, use:
tbl file | nroff -mm | col | more -s
Hewlett-Packard Company - 10 - HP-UX 11i Version 2: August 2003
more(1) more(1)
To display file stuff in a fifteen line-window and convert multiple
adjacent blank lines into a single blank line:
more -s -n 15 stuff
To examine each file with its last screenful:
more -p G file1 file2
To examine each file starting with line 100 in the current position
(third line, so line 98 is the first line written):
more -p 100g file1 file2
To examine the file that contains the tagstring tag with line 30 in
the current position:
more -t tag -p 30g
WARNINGS [Toc] [Back]
Standard error, file descriptor 2, is normally used for input during
interactive use and should not be redirected (see Input/Output section
in the manpage of the shell in use).
FILES [Toc] [Back]
/usr/share/lib/terminfo/?/* compiled terminal capability
data base
AUTHOR [Toc] [Back]
more was developed by Mark Nudleman, University of California,
Berkeley, OSF, and HP.
SEE ALSO [Toc] [Back]
csh(1), man(1), pg(1), sh(1), term(4), terminfo(4), environ(5),
lang(5), regexp(5).
STANDARDS CONFORMANCE [Toc] [Back]
more: XPG4
Hewlett-Packard Company - 11 - HP-UX 11i Version 2: August 2003 [ Back ] |