[Previous] [Contents] [Next]

more

Display files on a page-by-page basis (POSIX)

Syntax:

more [-ceisu] [-n number] [-p pattern] 
     [-/ pattern] [-t tag] [-x tabstop] [file...]

Options:

-/ pattern
Same as -p pattern.
-c
For each full screen of text that is displayed, clear the screen from the first line and display the next full screen of text.
-e
Stop after displaying the last line in the file. If the next command that displays text causes more to reach end-of-file again, more exits. If the file is shorter than a single screen, more exits at end-of-file regardless.
-i
Ignore case during searches. Uppercase and lowercase letters are considered identical.
-n number
Specify the number of lines that constitute a full screen of text. The number argument is a positive decimal integer. The -n option overrides any values obtained from the environment, and suppresses line numbering.
-p pattern
Search for a line that matches pattern. The current position is set to the first matched line. If no match is found, the first line in the file shall be the current position.
-s
Replace consecutive empty lines with a single empty line.
-t tag
Display the file containing the tag named by the tag argument. Note that for this to work, the file tags must reside in the current directory (see the ctags utility).
-u
Always display backspaces as control characters (e.g. as the two-character sequence ^H) and leave CR/LF (\r\n) sequences alone.

By default, more makes special use of backspaces and CR/LF (\r\n) sequences. If a backspace appears next to an underscore character, the character is displayed as underlined text, provided the terminal type supports underlined text. If a backspace appears between two identical characters, the first character is displayed as bold text, provided the terminal type supports bold text display.

-x tabstop
Set tabs at the positions specified by tabstop. The default is four spaces, unless the POSIX_STRICT environment variable is defined, in which case it is eight spaces.
file
A pathname of an input file. If no file operands are specified, more uses the standard input. If a file operand is the dash character (-), the standard input is read at that point in the sequence.

Description:

The more utility lets you view text files one screenful at a time. The utility determines the number of lines that make a full screen by looking in the terminal database. However, the LINES environment variable can be used to override the value found in the database, and the -n option can be used to override the LINES variable.

If the standard output isn't a terminal device, the number of lines that make up a full screen of text is considered to be infinite. In a pipeline, all input files are copied to the standard output in their entirety. On terminals, more displays text one screen at a time.

The more command can be very useful when another utility prints more information to the standard output than can be displayed on a single screen. By piping the output to more, you can scroll through the displayed output at leisure. For example:

    ls | more

pipes the output from the ls command to more, allowing you to scroll through the output.


Note: The more command is a link to less, which behaves according to the command name it was invoked as.

Environment variables:

EDITOR
Used to select an editor.
LINES
Interpreted as a decimal integer value to be used as the number of lines in a screenful.
MORE
Interpreted as a string containing options described in the Options section of this utility, preceded by hyphens and separated by blank characters as on the command line. Command-line options override those specified in the MORE variable. The MORE variable takes precedence over the TERM and LINES variables.
TERM
Interpreted as the name of the terminal type.
POSIX_STRICT
Interpret options according to POSIX specifications.

Exit status:

0
Successful completion.
>0
An error occurred.

Contributing author:

Mark Nudelman

See also:

cat, ctags, less


[Previous] [Contents] [Next]