Skip to main content

more command

more - A file perusal filter for crt viewing

The more command in Linux is a utility used to view file contents in the terminal, one page at a time. It’s simpler than less but still useful for reading files without flooding your screen.

Usage: more [OPTION]... [FILE]...

  • OPTION: Flags which enhances the more abilities.
  • FILE: The file you want to view.

Examples

  • Opening a File and Navigating

    To view a file, pass its name to more.

    $ more logfile.txt
    • Displays logfile.txt one screen at a time.

    • A percentage (e.g., --More--(23%)) shows your position in the file.

      KeyAction
      SpaceScroll down one page
      EnterMove down one line
      bScroll back one page (if supported)
      -dShow helpful prompts (e.g., "Press space to continue")
      -nSet the number of lines per page (e.g., -n 10)
      -sSqueeze multiple blank lines into one
      qQuit more
      /patternSearch for "pattern"
      +/patternStart at the first occurrence of "pattern"
      +numStart at line number "num" (e.g., +50)
    • Unlike less, more doesn’t let you freely scroll up in all implementations. Some versions support b for backward movement, but it’s not universal

    $ more +50 logfile.txt
    • Starts displaying logfile.txt from line 50.
    $ more +/error logfile.txt
    • Opens logfile.txt at the first instance of "error".
  • Searching in a File

    Search for text by typing / followed by your pattern.

    $ more logfile.txt
    # after file opens use /error
    /error
    • Type /error and press Enter to jump to the next occurrence of "error".
    • Press n to find the next match.
  • Viewing Multiple Files

    You can pass multiple files to more and switch between them.

    $ more file1.txt file2.txt
    • Opens file1.txt first.
    • After reaching the end, press : and then n (or just Enter) to move to file2.txt.
  • Piping Input

    Use more to paginate command output.

    $ ls -l | more
    • Displays the directory listing one page at a time.
$ more --help
Usage:
more [options] <file>...

A file perusal filter for CRT viewing.

Options:
-d, --silent display help instead of ringing bell
-f, --logical count logical rather than screen lines
-l, --no-pause suppress pause after form feed
-c, --print-over do not scroll, display text and clean line ends
-p, --clean-print do not scroll, clean screen and display text
-s, --squeeze squeeze multiple blank lines into one
-u, --plain suppress underlining and bold
-n, --lines <number> the number of lines per screenful
-<number> same as --lines
+<number> display file beginning from line number
+/<pattern> display file beginning from pattern match

-h, --help display this help
-V, --version display version