less command
Page through long files and command output.
- Text processing
- Package less
- 5 options · 5 examples
On this page
Syntax
less [options] [file]Provided by the less package. Run man less for the full manual.
Common options
| Option | What it does |
|---|---|
-N | Show line numbers |
-S | Don't wrap long lines |
-i | Case-insensitive search |
+F | Follow the file like tail -f |
-R | Show colours from command output |
Examples
Open a file
less /var/log/syslogShow line numbers
less -N app.logPage through command output
journalctl | lessFollow a growing log (Ctrl+C to stop, F to resume)
less +F /var/log/nginx/access.logKeep colours
grep --color=always error app.log | less -R
No example matches. Check the options table or search the guides.
Tips
- Inside less:
/wordsearches forward,nnext match,Gend of file,gstart,qquit.
