more Command: Tutorial & Examples
View the contents of a file one page at a time
The more
command is a utility that is used to view text files in a terminal window. It allows you to view the file one page at a time and navigate through the file using the
space bar to move forward and the b
key to move backward.
To view a file with more, simply type more followed by the name of the file:
more file.txt
This will open the file in more
and display the first page of the file.
more
is often used in conjunction with other commands, such as grep
or tail
, to filter and process the output of those commands
before viewing it in more. For example, you can use more to view the /var/log/messages
file by piping the output of cat
to more
:
cat /var/log/messages | more
more
is a simple and straightforward tool for viewing text files on a Linux system. It is often used as an alternative to the less
command, which has more
features. We recommend that you use less
instead of more
.
Further Reading
- Bash Cookbook by Carl Albing, J.P. Vossen
- Wicked Cool Shell Scripts by Dave Taylor, Brandon Perry
- Black Hat Bash by Nick Aleks, Dolev Farhi
- Bash Pocket Reference by Arnold Robbins
- The Linux Command Line by William Shotts
- Learning the Bash Shell by Cameron Newham
- Mastering Linux Shell Scripting by Mokhtar Ebrahim, Andrew Mallett
- Linux Command Line and Shell Scripting Bible by Richard Blum, Christine Bresnahan
- Shell Scripting by Jason Cannon