Overview
The more command is one of the original Unix file viewers (pagers), allowing you to read text files one screen at a time. While it has been largely superseded by the more feature-rich less command, more remains available on all Unix/Linux systems and is still useful for simple, forward-only viewing. Understanding more is important for working on minimal systems, legacy scripts, and understanding Unix history.
Syntax: more [OPTIONS] [FILE...]
The more command displays file contents one screenful at a time, pausing after each screen. Press Space to advance, Enter for one line, or 'q' to quit. Unlike less, more primarily moves forward through files and has more limited navigation capabilities.
Example 1
Basic File Viewing
$ more README.txt
This is a sample file for demonstration.
It contains multiple lines of text that will
be displayed one screen at a time.
Press Space to continue...
# At the bottom of screen:
--More--(45%)
# Press Space to see next screen
# Press Enter to advance one line
# Press 'q' to quit
# Press 'h' for help
What's Happening:
The most basic use of more displays a file one screen at a time. At the bottom, you'll see a prompt showing the percentage of the file displayed. Press Space to move forward by one screen, Enter to move forward by one line, or 'q' to quit. The percentage indicator helps you know how much of the file remains.
Note: If the file fits on one screen, more displays it all and exits immediately without pausing.
Example 2
Viewing Multiple Files
$ more file1.txt file2.txt file3.txt
::::::::::::::
file1.txt
::::::::::::::
Content of first file...
--More--(Next file: file2.txt)
# Press Space to continue to next file
::::::::::::::
file2.txt
::::::::::::::
Content of second file...
--More--(Next file: file3.txt)
# Skip to next file immediately:
# Press 's' to skip current file
# Press ':n' to go to next file
# Press ':p' to go to previous file (if supported)
$ more *.log
# View all .log files sequentially
What's Happening:
More can display multiple files sequentially. It shows a separator with the filename between files. You can navigate between files using special commands: 's' to skip the current file, ':n' for next file, and ':p' for previous (if your version supports it). This is useful for reviewing multiple log files or documents in sequence.
Pro Tip: Use wildcards to view related files: more /var/log/syslog* to view all syslog files.
Example 3
Starting at Specific Line Number
# Start viewing from line 100:
$ more +100 largefile.txt
[File content starting from line 100]
--More--(45%)
# Start from line 50:
$ more +50 /var/log/syslog
Nov 7 10:15:30 hostname systemd[1]: Started Session...
[continues from line 50]
# Combine with multiple files:
$ more +20 file1.txt +30 file2.txt
# file1.txt starts at line 20
# file2.txt starts at line 30
# Skip first 100 lines:
$ more +100 data.csv
# Useful for skipping headers in large data files
What's Happening:
The +N option makes more start displaying from line N instead of the beginning. This is invaluable when you know what part of a file interests you or when you want to skip headers. For large files, this saves time by jumping directly to the relevant section.
Note: Line numbers start at 1. Using +1 is the same as not using the option at all.
Example 4
Searching Within a File
$ more /var/log/syslog
# While viewing, press '/' to search
/error
# Finds next occurrence of "error"
# Search for pattern:
/failed
# Jumps to next "failed" string
# Continue search:
# Press 'n' for next occurrence
# Case-insensitive search (if supported):
# Some versions support this through options
# Search from start:
$ more +/ERROR logfile.txt
# Opens file and jumps to first "ERROR"
What's Happening:
While viewing a file, press '/' followed by a search term to find text within the file. More jumps to the next occurrence. Press 'n' to find subsequent matches. You can also use +/pattern when invoking more to start at the first match. This is useful for quickly locating specific errors or keywords in log files.
Limitation: Unlike less, more can only search forward, not backward. For more sophisticated searching, use less instead.