Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

less(1), the terminal file pager, seems to be missing lesskey(1) and the ability to rebind the keystrokes in less. The docs claim it's there, but it doesn't work. Am I crazy or is Apple's version of less broken?

$ less -k ~/.less /etc/fstab
There is no -k option ("less --help" for help)
$ less --help | grep lesskey
  -k [file]  .  --lesskey-file=[file]
                  Use a lesskey file.
$ which lesskey less
$ less --version | head -2
less 418
Copyright (C) 1984-2007 Mark Nudelman

I'm running Lion. It seems odd that Apple would mess with less(1) at all, it's such an old and standard Unix utility. (Less compiles easily from sources on MacOS, so I'm now using my own version.)

share|improve this question
As always, consider filing an enhancement bug report at If you don't have a developer account, it's free to create one. – Chris Page Oct 12 '11 at 4:32
up vote 6 down vote accepted

The Lion build of less indeed comes with the lesskey feature disabled, as can be seen by the customized defines.h it is being built with (line #define USERFILE 0). This doesn't mean it's broken, just that someone decided to customize the build and disable this feature for whatever reason. Sadly they neglected to update the man page, which is why it's still referring to it.

If you want this feature, building your own less from source is just a matter of ./configure && make install (which puts it into /usr/local), and you might also want to get a more recent version while you're at it.

share|improve this answer
Homebrew if you brew install less actually recommends the package homebrew/dupes/less which installs version 458 and has working lesskey. Much less work than manually building. – Steven Lu Apr 26 at 18:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.