65

When I first heard their names, I got really confused when I tried to guess what these tools might do, I thought I'd misheard something.

What's the difference between more and less, i.e. why should I choose one over the other?
They both seem to do the same thing...

Also, why are they named like that in the first place?

user541686
  • 23,629

5 Answers5

85

more is a basic pager, which allows you to scroll downwards, one page at a time. Only downwards.

less is also a pager, but has addition functionality to scroll upwards and downwards through the input, in addition to several other extensions.

So, yes. less is more, and more is less. Another common idiom (according to the wiki entry) is "less is more, more or less." The name comes from the fact that the author (Mark Nudelman) essentially wanted a program that was "backwards more" -- The opposite of more, is less.

Darth Android
  • 38,658
6

I find less a bit more friendly than more because you can use the arrow keys to stroll through the file. more only scrolls screen by screen (by default).

kevin
  • 115
iank
  • 162
  • 1
  • 6
3

Other that it allows more scrolling features, less also doesn't need to read the whole file, i.e. it loads files faster than more

yafrani
  • 130
2

Another difference between more and less, is that more leaves the (last page of the) output on the shell, while less leaves the shell clean.

Sometimes you might prefer one over the other. For example, if you need to copy-paste from the file, more can be better. However, in other cases you might prefer the 'cleaner' approach of less.

Zvika
  • 289
  • 1
  • 2
  • 7
0

More or less they also work well together:

more * | less

This shows the contents of matching files along with the decorated matching file and directory names.

Asclepius
  • 1,162