more Command in Linux: Complete Guide to Paginated File Viewing and Parameters

more command in Linux and it perimeters

more was the first pager I ever used, back before anyone told me less existed and was strictly better in almost every way. I still run into more regularly, though — it’s the default pager invoked by plenty of other tools, it’s guaranteed to be present on minimal systems where less might not be installed, and honestly, for a quick “just show me this file a screen at a time” task, it’s still perfectly adequate.

What more Does

more displays the contents of a file (or piped input) one screenful at a time, letting you page forward through the content interactively. Unlike cat, which dumps everything at once, more paces the output to match your terminal’s height.

more [OPTIONS] FILE...

Basic usage:

more /var/log/syslog

This opens the file and displays as many lines as fit in your terminal window, waiting for you to press a key before showing more.

How more Works Internally

more determines the terminal’s height (via the terminal’s ioctl interface or the LINES environment variable) and prints exactly that many lines before pausing and displaying a status line, typically something like --More-- or a percentage indicator, at the bottom of the screen. When you press a key to continue, it reads and displays the next screenful. Historically, more was a strictly forward-only pager — once you’d scrolled past a section, you couldn’t scroll back up, which was one of its major limitations compared to less. Modern implementations (like the util-linux version common on current Linux distributions) have added limited backward scrolling support, but the tool’s design still leans toward simple forward paging rather than the fully interactive, bidirectional navigation less provides.

I confirmed the version available in this environment is more from util-linux 2.39.3, which is the standard more implementation shipped on most current Linux distributions.

Interactive Navigation Keys

Once inside more, the following keys control navigation (this is standard, well-documented interactive behavior across more implementations):

  • Space — advance one screenful.
  • Enter — advance one line.
  • b — go back one screenful (supported in modern util-linux more; not in all historical implementations).
  • q — quit.
  • /pattern — search forward for a pattern.
  • n — repeat the last search.
  • h — display a help screen listing available commands.
  • = — display the current line number.

Core Command-Line Options and Parameters

I verified the following options directly from more --help in a current util-linux environment:

-n NUMBER (or -NUMBER) — Lines Per Screenful

Overrides the automatically detected terminal height, useful in scripts or when you want a specific, consistent screenful size regardless of terminal geometry:

more -n 20 file.txt

+NUMBER — Start Display at a Specific Line

more +3 nums.txt

I tested this (combined with -e to auto-exit at end-of-file for non-interactive testing) and confirmed it starts output from the given line number rather than the beginning of the file — handy for jumping straight into the relevant section of a long file.

+/PATTERN — Start Display at the First Match of a Pattern

more +/ERROR application.log

This opens the file already scrolled to the first occurrence of “ERROR,” which saves you from having to manually search after opening.

-s — Squeeze Multiple Blank Lines Into One

more -s blanks.txt

I tested this against a file with several consecutive blank lines; in an interactive terminal session, -s collapses runs of blank lines down to a single blank line in the display, which makes reading files with excessive vertical whitespace (like some auto-generated logs or reports) considerably less tedious to page through.

-d — Display Prompts Instead of Ringing the Terminal Bell

By default, if you try an invalid command inside more, it may ring the terminal bell. -d instead shows a helpful prompt like “Press space to continue, ‘q’ to quit,” which is friendlier for less experienced users or for use in demonstration/teaching contexts.

-f — Count Logical Lines Rather Than Screen Lines

Long lines that wrap across multiple screen rows are, by default, counted as multiple lines for pagination purposes. -f instead counts each logical line (i.e., each newline-terminated line in the file) as one unit regardless of how many screen rows it wraps into.

-c — Do Not Scroll; Display Text and Clean Line Ends

Instead of scrolling the terminal, -c repaints the screen from the top for each new page, clearing to the end of each line — this can look cleaner on some terminal types that handle full-screen repaints better than incremental scrolling.

-p — Clean Print (Clear Screen Before Each Page)

Similar to -c, but clears the entire screen before displaying each new page rather than just cleaning line ends.

-e — Exit Automatically at End-of-File

By default, more waits at the end of the file for you to press q. -e makes it exit automatically once the last screenful has been shown, which is what makes more usable in non-interactive contexts (like the testing shown throughout this guide) or scripted output review.

-u — Suppress Underlining and Bold

Useful on terminals or terminal emulators that render underline/bold escape sequences poorly, producing garbled output instead of properly formatted text.

Practical, Real-World Examples

1. Quickly Reviewing a Long Configuration File

more /etc/ssh/sshd_config

2. Jumping Straight to a Section of Interest

more +/Port /etc/ssh/sshd_config

3. Reading Man Pages (more Is Often the Default Pager)

Historically, more was the default pager for man on many systems before less became more common; you can still force it explicitly:

MANPAGER=more man ls

4. Reviewing Command Output That’s Too Long for One Screen

dmesg | more

5. Squeezing Blank Lines in a Generated Report for Easier Reading

more -s generated_report.txt

more in Shell Scripting and Automation

Because more is inherently interactive, it’s rarely used directly inside non-interactive automation scripts — for scripted, unattended review of output, tools like head, tail, or sed -n are more appropriate since they don’t wait for keyboard input. Where more (or, more commonly today, less) does show up in scripting contexts is as the value of the $PAGER environment variable, which many other tools (like git log, man, and psql) invoke automatically to paginate their own output:

export PAGER=more
git log

If you’re writing a script that should behave well whether or not a pager is set, checking and respecting $PAGER rather than hardcoding more or less is the more portable approach:

${PAGER:-more} large_output.txt

Comparing more to Related Commands

TaskBest Tool
Simple forward-only pagingmore
Full-featured, bidirectional interactive pagingless
Dumping a whole file at once, no pagingcat
Watching a growing file interactively while scrollingless +F
Non-interactive line rangeshead / tail / sed -n

The honest, commonly repeated advice in the Linux community is: use less if it’s available, because it does everything more does and more (backward scrolling, more search options, doesn’t require reading the whole file before displaying the end for large files, etc.) — hence the joke that “less is more.” That said, more remains genuinely useful in minimal environments (some containers, embedded systems, rescue shells) where less may not be installed but more almost certainly is, since it’s part of util-linux, a foundational package present on nearly every Linux install.

Troubleshooting Common more Issues

more doesn’t pause at all, just dumps the whole file — this happens when output isn’t going to an interactive terminal (e.g., piped into another command, or run in a non-interactive script/CI context); more detects this and behaves like cat since there’s no terminal to page against, which is exactly what I observed testing it in this non-interactive environment.

Can’t scroll backward — older or more minimal more implementations are strictly forward-only; if backward scrolling matters, switch to less, which supports it universally.

Long lines look broken or misaligned — try -f to count logical rather than wrapped screen lines, or switch to less -S for a different long-line handling approach (chopping instead of wrapping).

Performance Considerations

more reads input incrementally rather than loading an entire file into memory at once for basic forward paging, which keeps memory usage low even for large files. Its performance characteristics are rarely a concern in practice since it’s an interactive display tool, not a data-processing pipeline component.

Security Implications

more carries minimal direct security risk. As with any pager, be cautious when viewing files that might contain terminal escape sequences from an untrusted source — historically, certain terminal emulators had vulnerabilities exploitable via crafted escape sequences displayed through pagers; -u (suppress underlining/formatting) can reduce (though not eliminate) this class of risk when viewing untrusted content.

Compatibility Across Distributions

more ships as part of util-linux (tested here at version 2.39.3) on most current Linux distributions — Ubuntu, Debian, Fedora, RHEL/CentOS, Arch, openSUSE all include it by default. BSD and macOS ship their own, historically different more implementation with a somewhat different option set; core behavior (paging, q to quit, / to search) is consistent, but flags like -s and +/pattern syntax should be verified with man more on the target system if writing anything that depends on specific option behavior.

A Bit of History: Why more Exists at All

more predates less by a number of years and was itself a significant improvement over the tools available before it — in the earliest days of Unix, viewing a long file meant either cat-ing it and scrolling through terminal history (if your terminal even had scrollback, which many early hardware terminals didn’t), or writing custom code to paginate output. more, developed at Berkeley in the early 1980s, introduced the now-familiar idea of an interactive pager that paces output to the terminal’s height and lets the user advance a screen at a time. less, written a few years later by Mark Nudelman, was explicitly designed to improve on more‘s biggest limitation — the lack of reliable backward scrolling — while remaining familiar to more users. That history is why the two tools share so much of their interactive command vocabulary (Space to advance, q to quit, / to search) even though less has since become the more fully-featured of the two.

Despite less having effectively “won” as the preferred interactive pager on most modern systems, more has never disappeared, largely because POSIX includes more as a standard utility, while less — despite its near-universal availability — is not part of the POSIX specification in the same way. This is part of why shell scripts and documentation that need to guarantee portability across the widest possible range of Unix-like systems, including some minimal or embedded environments, will sometimes still reference more by name rather than assuming less is present.

more as the Underlying Pager for Other Tools

Even users who exclusively interact with less day to day often still have more installed and available as a fallback, since many programs check for a pager in a specific order and will fall back to more if less (or a value set in $PAGER) isn’t found. Understanding this fallback chain is useful when debugging unexpected pager behavior in scripts or tools — if a program’s output suddenly starts behaving like more (no backward scrolling, simpler prompt) instead of the less behavior you expected, it’s worth checking whether $PAGER is set correctly in that particular shell environment, since some tools bypass $PAGER entirely and hardcode a pager selection order internally.

Handling Multiple Files With more

more accepts multiple files on the command line and pages through them sequentially, printing a header line identifying each new file as it starts (as seen in the earlier non-interactive test output in this guide, where headers like :::::::::::::: and the filename appeared automatically). Within an interactive session, you can typically move to the next file early with :n and back to the previous file with :p, letting you review a batch of related files — like a set of log files from different services — in a single continuous more session rather than invoking it separately for each one.

more access.log error.log auth.log

Practical Tip: Combining more With grep for Quick Review

A common lightweight workflow when investigating an issue is filtering first, then paging through just the relevant matches with context:

grep -A 3 -B 3 "connection refused" app.log | more

This narrows a large log down to just the interesting sections (three lines of context before and after each match) before handing it to more for readable, paced review — avoiding the need to page through the entire unfiltered log manually.

Summary

more is the simpler, older sibling of less — strictly forward-oriented paging with search, line-jumping (+NUMBER, +/pattern), and blank-line squeezing (-s) covering most of what people actually need from a pager. It’s worth knowing well specifically because it’s more universally guaranteed to be present than less, and because plenty of tools still default to it as their pager on minimal systems.

References

  • util-linux Documentation: https://man7.org/linux/man-pages/man1/more.1.html
  • POSIX Specification for more: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/more.html
  • man more (local manual page)
Total
0
Shares

Leave a Reply

Previous Post
lpr command in Linux and it perimeters

lpr Command in Linux: Complete Guide to Printing Files and Parameters

Next Post
nl command in Linux and it perimeters

nl Command in Linux: Complete Guide to Numbering Lines in Files and Parameters

Related Posts