Less is More Than More on Linux…

By Angsuman Chakraborty, Gaea News Network
Sunday, November 4, 2007

I typically use more on Linux following my earlier habit from Unix & Sun / Solaris days; and it works fine for most purposes. However today I found out that less (which bills itself as opposite of more) is actually much more functional and useful than more.

For starters I use dual-monitors and I expect to be able to view the log (maillog) conveniently in a single line. more works as long as the terminal width isn’t too long. Apparently it has a limit on maximum number of characters beyond which it will automatically wrap around even if my terminal is wider. That is irritating to say the least. less does a fine job with wide terminals.

less does not have to read the entire input file before starting, so with large input files it starts up faster than text editors like vi (1). Less uses termcap (or terminfo on some systems), so it can run on a variety of terminals. There is even limited support for hardcopy terminals. (On a hardcopy terminal, lines which should be printed at the top of the screen are prefixed with a caret.)

Looks like my more days are over; I will be using more of less in the future (all puns intended).

November 8, 2007: 2:00 am

Thanks for the link on most. Their site says:

Most is a paging program that displays, one windowful at a time, the contents of a file on a terminal. A status line at the bottom of the screen displays the file name, the current line number and the percentage of the file so far displayed.

Unlike other paging programs, most is capable of displaying an arbitrary number of windows as long as they all fit on the screen, and different windows could be used to view the same file in different positions.

In addition to displaying ordinary text files, most can also display binary files as well as files with arbitrary ascii characters.

So we have yet another contender for the more or less game.

November 6, 2007: 10:23 am

You might wanna check out most (link to debian package) which is actually yet another pager…


will not be displayed