Less PDF
Less PDF
The less command is a program to view text files.
● Example
If you want to view a text file named myfile
less myfile
● If you want to quit viewing the file, Just press q
and this will close less.
● Why are we so interested in viewing text files ?
Because many of the system configuration files are text
based, and even scripts that are used by the system to
automate tasks are also textbased files.Basically, Most
of the files in Linux are textbased files.
less commands
key Action
Spacebar
or Next page
Page down
b
or Previous page
Page up
Up arrow Scroll up one line
Down arrow Scroll down one line
G Move to the end of the text file
g Move to the beginning of the text file
/text Search Forward to the next occurence of text
n Search for the next occurence of the previous search
h Display help screen
q Quit less