less command in Linux: page through a file
Updated July 3, 2026
The less command shows a file a page at a time, without reading the whole file into memory.
Syntax
less fileCommon cases
less /var/log/syslog # page through a file
journalctl | less # take input from a pipeline
# inside less:
# space / b - page forward / back
# /pattern - search, n for the next match
# q - quitHow it works: why less, not cat
caton a large file pushes the start off the screen, which you cannot get back.lessreads the file lazily as you scroll, so it opens even gigabyte logs instantly and uses little memory. The name is a pun on the older pagermore:lessscrolls both ways and searches, whilemoreonly went forward. On quitlessleaves no file on the screen.
Used in
You need this in the lesson Reading text. The theory is the chapter Reading and editing text.
See also
cat, head, tail, The file command.
Try it
Open the sandbox: a real throwaway Linux terminal in your browser. Run the commands above by hand - the container is deleted when you leave.