less — view and navigate file contents#
less command, you have more control
when viewing a file. It allows you to scroll up and down
the file and provides features like searching the file
To view the contents of a file, use
less, followed by the name of the file:
When the file is open, it will appear as in Fig. 78.
: prompt, you can type commands that less will
Navigating the file#
You can scroll down the file by pressing the ENTER key.
Alternatively, you can use the PgUp and PgDn keys to scroll one page at a time.
Searching the file#
You can search a file while viewing it in
To do this:
/(forward slash) key
Type the text you would like to search
Press the ENTER key
If there are matching results, they will be highlighted
To quit the less command, type
q at the prompt.