What it does
How to write it
more [OPTIONS] FILE...
COMMAND | moreMain parts
Keys inside more
Space- Next page.
Enter- Next line.
b- One page back (only for files, not pipes).
/pattern- Search forward. n = next match.
=- Show the current line number.
v- Open the file in your editor at the current line.
h- Help.
q- Quit.
Options 14
Most used
Nothing matches this filter.
Examples 11
$ run as a normal user# run as root (or with sudo)
1Read a file page by page
more /etc/servicesSpace = next page, q = quit.
2Page through long output
ps aux | moreOn minimal systems without less.
3Start at line 100
more +100 /var/log/messagesSkips the first 99 lines.
4Start at the first match of a word
more +/sshd /var/log/messagesJumps to the first line with sshd.
5Show friendly prompts instead of a beep
more -d READMEHelpful for people new to the terminal.
6Squeeze empty lines
more -s notes.txtSeveral empty lines become one.
7Show 20 lines per page
more -20 /etc/passwdUseful on small screens or in serial consoles.
8Page through the environment (Red Hat cheat sheet style)
env | moreClassic combination to read a long list.
9Read several files one after the other
more /etc/hosts /etc/resolv.confThe file name is shown between them;
:ngoes to the next file.10Open the editor from more
more /etc/fstab (press v to open the file in vi at the current line)Quick way from reading to editing.
11Use more as the pager for man (if less is missing)
PAGER=more man lsAny program that uses $PAGER can use more.
Nothing matches this filter.
Watch out
- Going back with
bdoes not work when more reads from a pipe.
Tips to remember
- more = forward only, simple. less = forward and back, search, follow.