Linux -- more View file content
NAME
more - file perusal filter for crt viewing
SYNOPSIS syntax
more [options] file [...]
DESCRIPTION
more is a filter for paging through text one screenful at a time. This version is especially primitive. Users should realize that less(1) provides more(1) emulation plus extensive enhancements.
more is a filter that displays scrolling text one screen at a time. This is a particularly original version. Users should know about less(1), which provides the basic functions of more(1) but enriches other functions.
OPTIONS options
Command-line options are described below. Options are also taken from the environment variable MORE (make sure to precede them with a dash (``-'')) but command line options will override them.
Command line options are detailed below. Options depend on the MORE environment variable, but command-line options also override the MORE environment variable.
-number
This option specifies an integer number which is the screen size (in lines).
This option specifies an integer that specifies the screen size, that is, the number of lines displayed at one time.
-d
more will prompt the user with the message "[Press space to continue, 'q' to quit.]" and will display "[Press 'h' for instructions.]" instead of ringing the bell when an illegal key is pressed.
The more command will prompt the user "[Press space to continue, 'q' to quit.]" at the bottom, and when an invalid value is typed, display "[Press 'h' for instructions.]" instead of ringing the bell.
-l
more usually treats ^L (form feed) as a special character, and will pause after any line that contains a form feed. The -l option will prevent this behavior.
more often treats ^L as a special character, and will pause when any line contains ^L. The -l option will cancel the function that will pause when the special character ^L is encountered (tried it, but found no use).
-f
Causes more to count logical, rather than screen lines (i.e., long lines are not folded).
When calculating the number of lines, use the actual number of lines, not the number of lines after a newline.
-p
Do not scroll. Instead, clear the whole screen and then display the text. Notice that this option is switched on automatically if the executable is named page.
Scroll bars are not displayed. Clear the screen first, then display the text.
-c
Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed.
Scroll bars are not displayed. Show from the top of the command window, then clean up the rest of the text.
-s
Squeeze multiple blank lines into one.
When there are two or more consecutive blank lines in the file, only one line is displayed.
-u
Suppress underlining.
Do not display the lower quotation marks (tried it and found no use).
+/
The +/ option specifies a string that will be searched for before each file is displayed.
Specify a string after the +/ option, search for the specified string before each document is displayed, and then start to display after the string.
+number
Start at line number.
Display from line number.
COMMANDS command
Interactive commands for more are based on vi(1). Some commands may be preceded by a decimal number, called k in the descriptions below. In the following descriptions, ^X means control-X.
The more interactive command is based on vi. Most commands are preceded by a decimal number , referred to as k in the following. In the following ^X means Ctrl+X.
h or ?
Help: display a summary of these commands. If you forget all the other commands, remember this one.
Displays simple command information.
SPACE
Display next k lines of text. Defaults to current screen size.
Display k rows down. Defaults to the current full screen size.
with
Display next k lines of text. Defaults to current screen size. Argument becomes new default.
Display k rows down. Defaults to the current full screen size. The parameter becomes the new default value.
RETURN
Display next k lines of text. Defaults to 1. Argument becomes new default.
Display k rows down. Defaults to the current full screen size. The parameter becomes the new default value.
d or ^D
Scroll k lines. Default is current scroll size, initially 11. Argument becomes new default.
Display k rows down. Defaults to half the current full screen size. The parameter becomes the new default value.
q or Q or INTERRUPT
Exit.
quit.
s
Skip forward k lines of text. Defaults to 1.
Skip the following k lines, and then display a new screen, skip 1 line by default.
^F
Skip forward k lines of text. Defaults to 1.
Skip the following k lines, and then display a new screen, skip 1 line by default.
f
Skip forward k screenfuls of text. Defaults to 1.
Skip the k screen below, and then display a new screen, skip 1 screen by default.
b or ^B
Skip backwards k screenfuls of text. Defaults to 1. Only works with files, not pipes.
Skip the above k screen, and then display a new screen, skip 1 screen by default. Only valid for files, invalid for pipes.
'
Go to place where previous search started.
Go back to where you last searched.
=
Display current line number.
Displays the line number of the current line.
/pattern
Search for kth occurrence of regular expression. Defaults to 1.
Search down to the position of the kth result that satisfies the regex condition. By default, search down to the first one.
n
Search for kth occurrence of last regular expression. Defaults to 1.
Search down the position of the k-th result that satisfies the last regular expression condition. By default, search down to the first one.
!command or :!command
Execute command in a subshell.
Execute an executable instruction.
v
Start up an editor at current line. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to vi if neither VISUAL nor EDITOR is defined.
Enables an editable tool on the current line.
^L
Redraw screen.
Regenerate the next screen.
:n
Go to kth next file. Defaults to 1.
Jump to the kth file after this, defaults to 1.
:P
Go to kth previous file. Defaults to 1.
Jump to the kth file before, default is 1.
:f
Display current file name and line number.
Displays the name of the current file and the current line number.
.
Repeat previous command.
Re-execute the previous command.
ENVIRONMENT environment
More utilizes the following environment variables, if they exist:
The more command utilizes the following environment variables when specified:
MORE This variable may be set with favored options to more.
This variable sets the more option to your liking.
SHELL Current shell in use (normally set by the shell at login time).
The shell currently in use (typically the login shell).
TERM Specifies terminal type, used by more to get the terminal characteristics necessary to manipulate the screen.
Specifies the terminal type, which is used by more to obtain the terminal characteristics needed to operate the screen.
VISUAL Editor the user is preferring. Used when key command v is pressed.
EDITOR Editor of choise when VISUAL is not specified.
SEE ALSO
vi (1), less (1)
AUTHORS
Eric Shienbrood, UC Berkeley
Modified by Geoff Peck, UCB to add underlining, single spacing
Modified by John Foderaro, UCB to add -c and MORE environment variable
HISTORY
The more command appeared in 3.0BSD. This man page documents more version 5.19 (Berkeley 6/29/88), which is currently in use in the Linux community. Documentation was produced using several other versions of the man page, and extensive inspection of the source code.
AVAILABILITY
The more command is part of the util-linux package and is available from Linux Kernel Archive <ftp://ftp.kernel.org/pub/linux/utils/util-linux/>.
util-linux September 2011 MORE(1)
case analysis:
1. Original document
[root@user test]# ls test.txt
2. Check the content of test.txt, only one blank line is displayed on multiple blank lines
[root@user test]# more -s test.txt
3. Check the content of test.txt and display it from line 10
[root@user test]# more +20 test.txt
4. Check the content of test.txt and display the location of 'String'
[root@user test]# more +/String test.txt