Displays file contents one screen at a time.
more [ -c ] [ -d ] [ -e ] [ -H ] [ -i ] [ -l ] [ -N ] [ -s ] [ -u ] [ -v ] [ -z ] [ -n Number ] [ -p Subcommand ] [ -t Tagstring ] [ -W Option ] [ -x Tabs ] [ File ... ]
The more command reads files and displays the text one screen at a time. The command pauses after each screen and prints the word More at the bottom of the screen. If you then press a carriage return, the more command displays an additional line. If you press the space bar, the more command displays another full screen of text.
Note: On some terminal models, the more command clears the screen, instead of scrolling.
Instead of naming files to read, you can either redirect or pipe standard output, such as a long directory listing, to the more command. The command adds a % (percent sign) to its prompt when reading from a file rather than a pipe. This provides the percentage of the file (in characters, not lines) that the more command has read.
The more command sets the terminal to NOECHO mode so the output can be continuous. With the exception of the / and ! subcommands, commands that are typed do not normally show up on the terminal. If the standard output is not a terminal, the more command will act just like the cat command, except that a header will be printed before each file in a series.
Environment variables affect the way the more command works. You can set some environment characteristics in the /etc/environment file and system profile files, such as the .ksh, .csh, and .profile files.
The more command uses the TERM variable to determine terminal characteristics. If this variable is NULL or not set, the command uses the default terminal type. The /usr/share/lib/terminfo directory contains definitions for terminal characteristics.
By default, the more command window size is 2 lines less than what the system terminal is capable of. The command sets the default window size based on the LINES variable. Also, you can easily adjust the window size for each run of the command by adding the -n flag.
Use the MORE variable to customize the more command with your preferred configuration each time the system starts. This variable accepts more command flags.
The more command accepts subcommands when the command pauses and as parameters for the -p flag. Many subcommands take an optional integer, symbolized here by K, which you must enter before the subcommand, with no space between. The more command, in the paused state, processes subcommands immediately and does not require you to press the Enter key.
The more command uses the following subcommands:
h | Displays a help screen that describes the more subcommands. |
v | Starts the vi editor, editing the current file in the current line. |
r or ^L | Refreshes the display. |
R | Refreshes the display and removes buffered input. |
[K](Spacebar) | Moves forward K lines when you press the spacebar. If you do not give a value for K, pressing the spacebar displays the next full screen by default. This spacebar subcommand is the same as [K]f or [K]^F or [K]z. |
[K]f or [K]^F or [K]z | Moves forward K lines, or one full screen if you do not give a value for K. |
[K]b or [K]^B | Moves backward K lines, or one full screen if you do not give a value for K. |
[K]d or [K]^D | Moves forward K lines, or half a screen if you do not give a value for K. If you give a value for K, the more command sets the d and u scroll size to K lines for the session. |
[K]u or [K]^U | Moves backward K lines, or half a screen if you do not give a value for K. If you give a value for K, the more command sets the d and u scroll size to K lines for the session. |
[K]j or [K](Enter) or [K]^E | Moves forward K lines, or one line if you do not give a value for K. |
[K]k or [K]^Y | Moves backward K lines, or one line if you do not give a value for K. |
[K]g | Moves to the beginning of the file, unless you give a line number for K. The default for K is line number 1. |
[K]G | Moves to the last line in the file, unless you give a line number for K. The default for K is the last line in the file. |
[K]p or [K]% | Moves to the point in the file that is K percent of the total file. The default for K is one percent, or the first line in the file. |
ma-z | Marks the current position in the file with the specified letter. |
'a-z | (Single quotation mark) Moves to the position marked with the specified letter. |
'' | (Two single quotation marks) Returns to the position from which the last large movement (moving more than a page) command was run. If no such movements have been made, returns to the beginning of the file. |
[K]/pattern | (Slash) Searches forward, from the current position, for the specified occurrence of the specified pattern of characters. The default value for K is the first occurrence. |
[K]/!pattern | (Slash, exclamation mark) Searches forward, from the current position, for the specified occurrence of a line that does not contain the specified pattern of characters. The default value for K is the first occurrence. |
[K]?pattern | (Question mark) Searches backward, from the current position, for the specified occurrence of the specified pattern of characters. The default value for K is the first occurrence. |
[K]?!pattern | (Question mark, exclamation mark) Searches backward, from the current position, for the specified occurrence of a line that does not contain the specified pattern of characters. The default value for K is the first occurrence. |
[K]n | Repeats the last search, specifying an occurrence of the pattern (or an occurrence not containing the pattern if the search subcommand included !). The default value for K is the first occurrence. |
:a | Lists the file or files you named in the more command line. |
:f or ^G or = | Displays information about the current file: |
:e[File] or E[File] | Examines the specified file, provided you named it in the more command line. |
[K]:n or [K]N | Examines either the next file (if you do not give a value for K) or the file K number of positions forward in the list of files you named in the more command line. |
[K]:p or [K]P | Examines either the previous file (if you do not give a value for K) or the file K number of positions backward in the list of files you named in the more command line. |
:t Tagstring | Displays the portion of the file that contains the specified tag. This subcommand works only on files containing tags created with the ctags command. The :t subcommand is the interactive version of the -t flag. |
:q or q or Q | Exits the more command. |
:!command or !command | Starts the specified command in a new shell. |
H | Toggles the search pattern highlighting feature on or off. |
This command returns the following exit values:
0 | Successful completion. |
>0 | An error occurred. |
/usr/share/lib/terminfo | Indicates the terminal information database. |