Skip to main content

Advantages of less over more

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) G seek to end of file or linee specified (ie 20g) m marks position (ie mz) ’ returns to position (ie ’z) s save the input if less input is a pipe (s file.txt)