Forever & AlwaysLINUX COMMAND ATLAS

LINUX COMMAND ATLAS · COMMAND GUIDE

Linux less command

Read long text one screen at a time. Search with / and quit with q.

less manual

Syntax

Command form
less [OPTION]... [FILE]...

Common options

6 options
OptionWhat it does
-N, --LINE-NUMBERSShow line numbers.
-S, --chop-long-linesDo not wrap long lines; scroll horizontally instead.
-iIgnore case in searches when the pattern has no uppercase letters.
-F, --quit-if-one-screenExit if the entire file fits on one screen.
-RAllow ANSI colour and control sequences to pass through.
+FFollow file growth, similar to tail -f; Ctrl+C returns to browsing.

Usage examples

3 examples

Read long text one screen at a time. Search with / and quit with q.

less /var/log/syslog

Browse a log with line numbers.

less -N /var/log/syslog

Follow new log output, then press Ctrl+C to browse.

less +F app.log

Notes

Press q to quit. Search with /text, then use n and N to move between matches.