moredisplay files on a page-by-page basis |
Command |
more
[-ceiSs]
[-A|-u]
[-n number]
[-P prompt]
[-p command]
[-t tag]
[file ...]
more
[-ceiSs]
[-A|-u]
[-n number]
[-P prompt]
[-t tag]
[+command]
[file ...]
more command displays files one page at a time. It
obtains the number of lines per page from the environment or from the
-n option. If the standard output is not a terminal device,
the number of lines per page is infinite.
If more than one file is specified, they are displayed one at a time. When
more finishes displaying one file, it begins displaying the
next one in the list. If you give - as one of the file names,
more reads the standard input at that point in the sequence.
more allows paging forwards and backwards (if possible) and
searching for strings.
-Acauses the display of all characters, including unprintable ones.
Normally unprintable characters are displayed in a printable format.
Further, ANSI escape sequences for display modes are processed. This
option cannot be used with -u.
The character in the top left corner of the screen always appears in normal mode.
-cclears the screen before displaying a new file. If at any time, the new
screen to be displayed does not have any lines in common with the current
screen, more does not scroll, but instead, redraws the
screen one line at a time, starting from the top.
more may ignore this option if the terminal does not
support such operations.
-eexits immediately after displaying the last line of the last file.
Normally, if standard output is a terminal device, more
stops after displaying the last line of the last file and prompts for a
new command. If the command that displays text causes
more to reach the end of the file again,
more exits.
-iignores case during searches.
-n numberspecifies the number of lines per page. This overrides any values obtained from the environment.
-P stringsets the prompt that appears at end of each page of text to
string. The default prompt is
[filename]. more
normally displays the prompt in STANDOUT mode.
-p command+commandinitially executes the more command on each file.
If it executes successfully and command is a positioning command
such as a line number or a regular expression search,
more displays the resulting page; otherwise
more displays the first page of the file. If both the
-t and -p options are specified,
the -t option is processed first.
-Sdisplays the prompt in normal mode rather than STANDOUT mode.
-sreplaces consecutive empty lines with a single empty line. Remember
that all line numbers (for example, as specified with the
p) will refer to the lines in the new file (that is,
the file with the consecutive empty lines replaced).
-t tagsearches for the named tag and displays the page of text
containing it. See ctags for
more information.
-udisplays all backspaces as ^H. Normally
characterbackspace_(underscore) displays character as
underlined and characterbackspacecharacter displays
character as boldfaced. -u also displays all
carriage returns as ^M. This option cannot be used with
-A.
more also accepts the following interactive commands.
bCTRL-BPgUpmoves backward n lines, with a default of one page. If n
is more than the page size, more displays only the
final page.
dCTRL-Dscrolls forward n lines, with a default of one half of the page
size. If you specify n, it becomes the new default for subsequent
d and u commands.
fCTRL-FPgDnmoves forward n lines, with a default of one page. At
end-of-file, more continues with the next file in the
list, or exits if the current file is the last one in the list.
Ggoes to the nth line in the file. If you do not specify n,
more advances to the end of the file.
ggoes to the nth line in the file, with the default being the first line of the file.
hdisplays a summary of interactive commands.
jSPACEENTER↓scrolls forward n lines, with a default of one line for
j, ENTER and
↓, and a default of one page for
SPACE. This command displays the entire n lines
even if n is more than the page size. At end-of-file, these
commands cause more to begin displaying the next file
in the list, or to exit if the current file is the last one in the
list.
k↑scrolls backward n lines, with a default of one line. This command displays the entire n lines even if n is more than the page size.
mlettermarks the current position with the lowercase letter. When you view a new file, all previous marks are lost.
Nrepeats the previous search, but in the opposite direction. If you
specify n, more repeats the search n
times.
nrepeats the previous search. If you specify n,
more repeats the search n times.
For example, if there are eight occurrences of pattern in the file
and /pattern found the second occurrence, a follow-up
command of 5n finds and sets the current position to
the 7th occurrence of pattern.
q:qZZexits more.
Rrefreshes the screen and discards any buffered input.
rCTRL-Lrefreshes the screen.
sskips forward n lines (with a default of one line) and displays
one page beginning at that point. If n would cause less than a full
page to be displayed, more displays the last page in
the file.
uCTRL-Uscrolls backward n lines, with a default of one half of the page
size. If you specify n, it becomes the new default for subsequent
d and u commands.
vinvokes an editor to edit the current file. more
uses the editor named by the environment variable
EDITOR. The default editor is
vi.
'letterreturns to the position marked with letter.
''returns to the position where you last issued a movement command of greater than one page or the beginning of the file if you have issued no such commands.
:e [filename]ENTERstops viewing the current file and views filename instead. If
you do not specify filename, more returns to
the beginning of the current file. If filename is #,
more returns to the last file viewed before the
current one.
:nviews the next file from the list given on the command line. If you
specify n, more views the nth next file
from the list.
:pviews the previous file from the list given in the command line. If you
specify n, more views the nth previous
file from the list.
:t tagnamegoes to tagname (see
ctags).
:w filenamewrites the contents of the current file to the file filename.
!sh_cmdescapes to shell and executes sh_cmd as a shell command.
=CTRL-Gdisplays, where possible, the name of the file currently being viewed, its number (relative to the total number of files specified in the command line), the current line number, the current byte number, the total bytes to display and what percentage of the file has been displayed.
/[!]patternsearches forward in the file for the nth line containing
pattern. n defaults to one if not specified. If
pattern is the null regular expression (/),
more uses the previous pattern. If the
character ! precedes pattern, more
searches for lines that do not contain pattern.
?[!]patternsearches backward in the file for the nth line containing
pattern. The search begins at the line immediately before the top
line displayed. n defaults to one if not specified. If
pattern is the null regular expression (?),
more uses the previous pattern. If the
character ! precedes pattern, more
searches for lines that do not contain pattern.
HOMEgoes to the first line in the file.
ENDgoes to the last line in the file.
COLUMNScontains the maximum number of columns to display on one line.
EDITORcontains the name of the editor that the v command
invokes.
LINEScontains the number of lines in a page. This value takes precedence
over the value provided by TERM; however, the
-n value takes precedence over the
LINES value.
MOREcontains a list of options (from those listed in the
Options section) as they would appear on the
command line. This variable takes preference over the
TERM and LINES
variables.
TERMcontains the name of the terminal type.
0Successful completion.
>0Failure due to any of the following:
-n option too large-p option-A, -P and -S
options, and the :w and ! commands are
extensions to the POSIX standard. The HOME,
END, PgDn, PgUp,
↓ and ↑ commands are
extensions to traditional implementations of more, available
only on terminal types that support these keys.