Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

  1. Home
  2. Bash Dictionary
  3. less / more

less / more

less and more are commands for viewing file contents one page at a time. They are commonly used to read large log files or manual pages. less offers more features than more and is the preferred choice in modern usage.

Syntax

less [options] [file]
more [options] [file]

Options and Key Bindings

Option / KeyDescription
less fileOpens a file in paged view.
less -N fileDisplays line numbers.
less -S fileDisables line wrapping; long lines can be scrolled horizontally.
less +G fileOpens the file starting from the last line.
less +F fileOpens the file in real-time follow mode, equivalent to tail -f.
qQuits less / more.
Space / fMoves forward one page (one screen).
bMoves back one page (less only).
↑ / ↓ or j / kScrolls one line at a time (less only).
g / GJumps to the first / last line (less only).
/keywordSearches forward for a keyword (less only).
n / NMoves to the next / previous search result (less only).
hDisplays help (less only).

Sample Code

Opens a file in paged view. A prompt (:) appears at the bottom of the screen, and you can navigate with key bindings.

less /var/log/syslog

Displays a file with line numbers. Useful for reviewing scripts.

less -N script.sh
      1 #!/usr/bin/env bash
      2 set -euo pipefail
      3
      4 echo "Hello, World!"
      5 echo "Today is $(date)"
:

Pages through output received from a pipe.

grep "ERROR" app.log | less

Monitors a file in real time (similar to $ tail -f). Press Ctrl+C to stop monitoring and switch to normal less navigation.

less +F /var/log/app.log
2026-03-06 12:00:01 [INFO] Server started
2026-03-06 12:00:05 [INFO] Connection accepted
2026-03-06 12:00:12 [WARN] Slow query detected
Waiting for data... (interrupt to abort)

Views a file with long lines without wrapping. Use the left and right arrow keys to scroll horizontally.

less -S wide_csv_file.csv

Type /ERROR inside $ less to search for lines containing "ERROR". Press n to jump to the next result, and N to go back to the previous one.

less /var/log/app.log
# Type /ERROR after opening to search

The $ man command uses $ less internally. You can navigate it with the same key bindings.

man bash

$ more is a simpler pager that does not support scrolling back to previous pages. Use it for quick, straightforward viewing.

more /etc/fstab

Notes

Unlike $ more, $ less does not load the entire file into memory at once, so it can open even multi-gigabyte log files quickly. It also supports backward navigation. When used with a pipe, it reads from standard input (e.g., grep "ERROR" app.log | less).

To follow the end of a file in real time, tail -f is also commonly used. To display an entire file at once, see cat.

If you find any errors or copyright issues, please .