Advantages of less over more (UNIX)

This article is intended to provided reasons to use the UNIX program less over its predicessor more.

What is less?
If you use the whatis program for less on a UNIX terminal you get “opposite of more”. What does this mean? more allows a user to incrementally display text from the beginning scanning forward. less allows a user to view text backwards (in addtion to forwards).

Why use less?
less, in addition to forwards-backwards scrolling, also supports sideways scrolling. This gets rid of the wordwraping that more uses.
The controls are simpler. The arrow keys control movement. In addition the old controls work as well.
Another advantage of less is that it can start up before reading the entire file (which more has to wait for).

Useful features of less /keyword performs a search for keyword ?keyword performs a search for keyword backwards n repeats last search N repeats last search backwards g seek to beginning of file or line specified (ie 20g)^1^ G seek to end of file or line specified (ie 20G)^1^ m marks position (ie mz) ’ returns to position (ie ’z) s save the input if less input is a pipe (s file.txt) p or % jump to point in file. value must be between 0 and 100 (ie 20%)

1 Warning: may be slow if number specified is large

Useful commandline options -N prefix line numbers to every line -jn jump to line n -xn[,m]* set tab location (ie less -x5,10,12 will align tabs to 5th line, 10th line, 12th line, 14th, 16th, 18th lines… because the difference of the last two is 2)

More help can be found using the following lines:
man less
less --help