The more
command is similar to less
in that it allows you to browse the contents of a file in a paginated manner. After exiting the more
command, the operations performed will remain on the shell. While browsing in pagination, you can use the h
key to output the help file.
more [options] [file]
-d
: Prompts the user to display[Press space to continue, 'q' to quit.]
at the bottom of the screen. If the user presses the wrong key, it will display[Press 'h' for instructions.]
instead of beeping.-f
: Calculates the actual number of lines, not the number of lines after automatic line wrapping. Some single-line words that are too long will be expanded into two or more lines.-l
: Disables the feature that pauses when encountering the special character^L
for page breaks.-c
: Instead of scrolling, it draws each screen from the top, clearing the remaining parts of each line displayed, similar to-p
, but different in that it first displays the content before clearing other output.-p
: Does not display each page in scroll mode, but clears the output first before displaying the content.-s
: Substitutes consecutive blank lines with a single blank line.-u
: Hides the underscore, which varies depending on theterminal
specified by theTERM
environment variable.-<num>
: Specifies the number of lines per screen.+<num>
: Displays the content starting from linenum
.+/<str>
: Searches for the stringstr
before displaying each document, and then begins displaying from that string onwards.-V
: Displays version information.
h or ?
: Help menu, displays a summary of commands.SPACE
: Display the nextk
lines of text, with the default being the current screen size.Enter
: Moves downn
lines, wheren
needs to be defined, defaulting to1
line.Ctrl+F
: Scrolls down one page.Ctrl+B
: Goes back one page.=
: Outputs the line number of the current line.:f
: Outputs the file name and the line number of the current line.V
: Invokes thevi
editor.! <cmd>
: Invokes theShell
and executes the command.q
: Exits themore
command.
Paginate the contents of the /var/log/ufw.log
file.
more /var/log/ufw.log
Display the contents of the /var/log/ufw.log
file starting from line 20
.
more +20 /var/log/ufw.log
Paginate the contents of the /var/log/ufw.log
file, with 1
line per page.
more -1 /var/log/ufw.log
https://github.com/WindrunnerMax/EveryDay
https://www.runoob.com/linux/linux-comm-more.html
https://www.tutorialspoint.com/unix_commands/more.htm
https://alvinalexander.com/unix/edu/examples/more.shtml