less
FilesBeginner In simulator In real LinuxView a file page by page, with scrolling and search
Name: less: more than more ("less is more")
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
less is a pager: it shows a file one screen at a time and lets you scroll back and forth and search. It doesn't read the whole file first, so even huge files open instantly.
Keys: space next page, b back, / search, n next match, g/G start/end, q quit. man usually displays pages through less.
Syntax
less [OPTION]... FILE...Common options
| -N | Show line numbers |
| -S | Chop long lines instead of wrapping |
| -i | Searches ignore case (unless they contain capitals) |
| -R | Show colours properly (output of grep --color=always, say) |
| -F | Quit at once if the text fits on one screen |
| -X | Leave the text on the screen after quitting |
| +F | Follow the end like tail -f (Ctrl+C stops following) |
| /text | (inside less) Search for text; n for the next match |
| ?text | Search backwards for text |
| n / N | Next / previous match |
| g / G | Go to the start / the end |
| q | (inside less) Quit |