more: Display the contents of a file one screen at a time
August 9th, 2024 9:29 AM Mr. Q Categories: Command
Command: more
Used to view the contents of a file one screen at a time. Useful for reading long files or outputs that do not fit on a single screen.
Sample Command and Output:
$ more file1.txt
This is the content of file1.txt.
It spans multiple lines.
--More--(5%)
Description:
more file1.txt
: Displays the contents offile1.txt
one screen at a time. Use the spacebar to advance to the next screen andq
to quit.
Sample Command and Output:
$ more /var/log/syslog
-- Logs begin at ... --
[Syslog entries displayed one screen at a time]
--More--(20%)
Description:
more /var/log/syslog
: Views the/var/log/syslog
file one screen at a time. Useful for examining system logs. The--More--
prompt indicates that additional content is available.
Additional Navigation Commands:
- Spacebar: Moves to the next screen.
- Enter: Moves down one line at a time.
- b: Moves back one screen (if supported).
- q: Quits the
more
viewer.
Sample Command and Output:
$ more -d file1.txt
[Displays file contents one screen at a time, with prompts for navigation]
Description:
more -d file1.txt
: Displaysfile1.txt
with user prompts for navigation. The-d
option provides informative prompts when the user attempts to navigate beyond the end of the file.