more (another pager, less features than less)
The more command is the original UNIX pager, designed to view text one screenful at a time. It is simpler than less, offering basic forward scrolling but typically lacking the ability to scroll backward or search as effectively.
Example 1: Basic file viewing
# View the content of a text file one page at a time
more README.md
Explanation: This command displays the first screen of README.md. You can press the Spacebar to advance to the next page or Enter to advance one line at a time.
Example 2: Paging through command output
# List all processes and pipe the output through 'more'
ps aux | more
Explanation: Like less, more is commonly used with a pipe to manage long command outputs. This makes the extensive list of processes easy to read page by page.
Example 3: Starting at a specific line number
# Open a file and start the view at line 100
more +100 large_file.txt
Explanation: The +<num> option tells more to begin displaying the file at the specified line number. This is useful for jumping directly to a known area of interest.
Example 4: Starting at the first occurrence of a string
# Open a file and start at the first line containing the word "ERROR"
more +/ERROR system.log
Explanation: Using +/pattern instructs more to search the file and begin the display at the first line that contains the specified text pattern.
Example 5: Limit the number of lines per screen
# Display a file with only 10 lines per page
more -10 my_list.txt
Explanation: You can control the page size by specifying a number with a hyphen. This command will pause after every 10 lines instead of a full screen.
Example 6: Squeeze multiple blank lines
# Display a file, compressing multiple empty lines into one
more -s file_with_blanks.txt
Explanation: The -s option provides a cleaner view by reducing any sequence of two or more blank lines down to a single blank line in the output.
Example 7: Prompt before clearing the screen
# Use the -c option to draw pages from the top without scrolling
more -c data.csv
Explanation: The -c option prevents the screen from scrolling. Instead, it clears each page before drawing the next one, which some users find easier to read.