Browse a log with line numbers.
less -N /var/log/syslogRead long text one screen at a time. Search with / and quit with q.
less [OPTION]... [FILE]...Browse a log with line numbers.
less -N /var/log/syslogFollow new log output, then press Ctrl+C to browse.
less +F app.log| Option / clause | Description |
|---|---|
-N, --LINE-NUMBERS | Show line numbers. |
-S, --chop-long-lines | Do not wrap long lines; scroll horizontally instead. |
-i | Ignore case in searches when the pattern has no uppercase letters. |
-F, --quit-if-one-screen | Exit if the entire file fits on one screen. |
-R | Allow ANSI colour and control sequences to pass through. |
+F | Follow file growth, similar to tail -f; Ctrl+C returns to browsing. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.