Why do Linux people and most programs -- Ruby commands, for instance -- use less
instead of more
. Isn't more bigger, nicer, and better? What is the advantage to less
?
-
2your next assignment is to determine the differences between cat and dog, and why the latter never took off... :D– quack quixoteFeb 1, 2010 at 20:04
-
1dog is nice, also most is a decent pager.– Justin SmithFeb 1, 2010 at 21:53
-
dog support was discontinued after Debian Lenny and Ubuntu Jaunty :'(– raphinkFeb 2, 2010 at 14:45
4 Answers
Because less is more than more...
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.)
-
-
-
-
@Yar I do. None of the pagers read the entire input until necessary. The main advantage of less is the one Nifle describes.– TobuFeb 2, 2010 at 10:57
-
@Tobu, what is the main advantage? That
less
USED TO be the only one to allow you to go backwards? Also, why is mymore
command runningless
on OSX? This is beginning to sound like a conspiracy. Feb 2, 2010 at 14:18
"Most programs-- Ruby commands, for instance", should be using whatever pager is the default instead of explicitly using a particular one. You can set your preferred pager via the $PAGER environment variable, and any properly behaving program will use that pager. I recommend checking out most as well. view can be nice if you are a fan of vi.
Does anyone know of a pager that has emacs keybindings out of the box (or, even better, a way to use emacsclient as a pager that accepts data from stdin)?
-
@Justin Smith, thanks for that. Make your question a proper question and it shall be answered (not by me, of course). Feb 1, 2010 at 23:30
You should be aware to the most
pager, adding the capability of viewing multiple files simultaneously.