The more command is used to page through the contents of one or more files on the terminal.
more displays its output by scrolling up lines on the screen.
Syntax
Format 1: | more[ -cdefisu][ -n number][ -p command][ file]... |
Format 2: | more[ -cdefisu][ -n number][ +command][ -lines] [ +line_number][ +/pattern][ file]... |
No option specified The output is displayed one screenful at a time by default and can be controlled further with the commands described below. If you do not specify any of the options or built-in commands, more pauses after each screenful. After the first screenful, If you press the space bar (on block-mode terminals space bar and DUE), more displays another screenful. If you press only the enter key (resp. DUE), the screen is scrolled one more line down. more provides a two-line overlap between screens for continuity. If more is reading input from a file, the percentage of lines displayed so far is also shown (
more clears the screen before displaying a new page; useful on faster displays. The -c option is ignored if the terminal does not have the ability to clear the screen.
On block terminals, comments and warnings referring to unavailable screen control facilities are suppressed.
Causes more to automatically exit the file the first time it reaches the end of the file. By default, more exits when it reaches the end of the file for the second time.
more does not fold long lines that extend beyond the right edge of the screen. The -f option cannot prevent line breaks automatically generated by the terminal hardware. more continues to count the displayed lines as if no line breaks have occurred.
Case is ignored during a search, i.e. lowercase and uppercase are regarded as the same. A search can also be conducted for overscored or underscored text. This option is ignored if the search pattern itself contains uppercase letters.
more compresses the output file by replacing multiple blanks with a single blank.
more suppresses generation of underlining escape sequences. -u not specified:
Specify the number of lines per screenful. The number argument is a positive decimal integer.
The -p option in the command line is the same as specifying +/ command, i.e. more executes command each time at new file is displayed. This is the same as the + command that is also supported.
The value which you specify for lines defines the number of lines in each screenful.
more starts output of the file at the given line_number.
pattern is a regular expression which may be used to browse through a text file. The output begins two lines above the string which matches pattern.
Name of the file or files to be displayed. If multiple files are given, the name of the current file is displayed in a header line before each file. |
Commands
When more pauses at the end of a screenful, you can control subsequent output with the following commands:
more displays n more lines. If you press the space bar (on block-mode terminals space bar and DUE) without a value for n, the next screenful is displayed.
more displays n more lines. If you press the enter key without a value for n, the next line is displayed.
more displays n more lines and sets the scroll size to n.
more sets the number of lines per screenful to n and displays the next screenful.
more skips n lines of output and prints the text that follows. The omission is indicated by a comment at the skipped position.
The number you specify for n defines how many screenfuls are to be skipped. The number of lines omitted as a result is indicated at the skipped position.
more skips back n screenfuls.
Q :q |
Functionality
The more command set the terminal to noecho mode. In other words, more’s built-in commands are not displayed on your terminal when you enter them, except for regular expressions, the exclamation point, and the slash. more operates in cbreak mode, which means that the commands listed above are processed as soon as they are completed and need not be confirmed with the enter key. This mode also causes both commands to automatically terminate at the end of the text file. Since more is generally more efficient at skipping forward than back, it is not very suitable for performing reverse searches on large files. more discovers the terminal’s display characteristics by reading the terminfo files. |
File
/usr/share/lib/terminfo/* File containing display characteristics. /usr/lib/more.hlp Help file |
Variable
COLUMNS Override the system selected horizontal screen size. EDITOR Used by the v command to select an editor. LINES Override the system selected vertical screen size. The -n option takes precedence over the LINES variable for determining the number of lines in a screenful. |
Locale
The following environment variables affect the execution of more: LANG Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined. LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_COLLATE Determine the locale for the behavior of ranges, equivalence classes and multicharacter collating elements within regular expressions. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments and input files) and the behavior of character classes within regular expressions. LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. |
Example
Displaying the file named test, starting at the location of the word example and without folding long lines:
The output begins two lines above the first line which contains the word example. |
See also
cat, ed, man, sh |