3

Just when I was getting curious about less vs. more

I am running Snow Leopard. When I type more it says

Missing filename ("less --help" for help)

So I type whereis more and it says /usr/bin/more. Okay, so I run that and it says the same thing. Even man more says

NAME
       less - opposite of more

Was more killed as part of my Snow Leopard install, or was it something else that I installed that did this?

4 Answers 4

4

I don't know whether Leopard had it when I was running it. I just don't use more; less is just so much more powerful. Both man more and man less open the same manpage, which is that of less. If you look at the sizes of the files /usr/bin/more and /usr/bin/less, they are identical. The two binaries are identical as well.

4
  • cool, at least it's not me Feb 2, 2010 at 15:17
  • 3
    yes, they are identical (there's a hardlink from less to more) stat output that shows this: stat more -> inode 11892499 stat less -> inode 11892499 Much like vi and view.
    – skarface
    Feb 2, 2010 at 16:47
  • Thanks @skarface, I had no idea that two filenames could point to the same resource. That's different than a symbolic link, I suppose. Feb 2, 2010 at 23:42
  • @Yar: Also try ls -li {/usr,}/bin/{less,more}. The -i will show the inodes and the brace expansion will show the various locations (including errors if they don't exist in those locations). type -a less more will show locations, aliases and function definitions (but not inodes or whether symlinks exist). Oct 3, 2010 at 17:42
3

For quite some time a lot of linux distributions have aliased or symlinked more to less, I assume OSX has done the same thing.

Chances are that you never had the original more installed.

2
  • 1
    @Yar: By contrast, more on my system is its own binary. While it's much more capable than the original more, it still falls far short of less. The version of more I have doesn't report a version number, but it's part of the util-linux-ng on Ubuntu 9.10. Another pager that you might like to take a look at is most. Oct 3, 2010 at 17:58
  • Thanks @Dennis Williamson, I will check out most as well. Oct 3, 2010 at 20:47
2

Unfortunately, my level is too low to comment on one of the other answers... so here's an out-of-line comment: On Leopard, both more and less can be found in /usr/bin, with the same file size, date, and length. Interestingly neither is a link to the other:

-rwxr-xr-x 2 root wheel 254288 May 31 2008 /usr/bin/less

-rwxr-xr-x 2 root wheel 254288 May 31 2008 /usr/bin/more

So I guess Snow Leopard is indeed different, I didn't add these.

3
  • 2
    They are linked, just with a hardlink, not a symbolic link, which is why you don't see the -> in ls. Take a look at my comment above, stat shows that they are both on the same inode.
    – skarface
    Feb 2, 2010 at 16:48
  • Is it possible to make our own hardlinks?
    – macek
    Feb 5, 2010 at 22:16
  • @macek: Yes, just use ln. Nicely explained here: en.wikipedia.org/wiki/Hard_link
    – sleske
    Oct 2, 2010 at 21:46
1

As noted more & less are actually the same binary, but it behaves differently depending on which name was used to run it, so you get the benefits of both.

1
  • example? I thought that it performs the same Feb 6, 2010 at 8:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .