less is a Linux-based program that can be used to read sections of large text-based files to the terminal. Unlike
less will limit the output to the height of the current terminal session and implements a scroll buffer to scroll forward and backwards through the file.
A consequence of
less implementing it’s own scroll buffer is that the terminal history will not be polluted with the contents of the file once
less is closed.
Type the following at the command-prompt to open a file for viewing in
$ less my_file.txt
less, use the arrow keys to scroll forward and back in the file. You can also use the mouse wheel for scrolling.
Q to exit
You can search for text in
less with the
/<search string> command:
less, the following will find the first instance of
To continue jumping to each successive match, press
To include spaces in the search pattern you must enclose the search pattern in quotes: