Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I need to work on a Solaris server over ssh from my Ubuntu (Lucid) laptop. I got Home/End Insert/Delete Page Up/Down working in csh and bash using bindkey and ~/.inputrc, respectively. But I can't figure out how to get them working in less. How can I figure out what the problem is, and fix it?

share|improve this question
up vote 9 down vote accepted

I found the answer here, in section 4.4. less (1).

to use it with the movement keys, have this plain ASCII file .lesskey in your home directory:

^[[A   back-line
^[[B   forw-line
^[[C   right-scroll
^[[D   left-scroll
^[OA   back-line
^[OB   forw-line
^[OC   right-scroll
^[OD   left-scroll
^[[6~  forw-scroll
^[[5~  back-scroll
^[[1~  goto-line
^[[4~  goto-end
^[[7~  goto-line
^[[8~  goto-end

then run the command lesskey. (These are escape sequences for vt100-like terminals.) This creates a binary file .less containing the key bindings.

share|improve this answer
By the way, the rest of that document that I linked to describes how to set up the special keys in all the other programs, including shells. It's excellent stuff. – Ryan Thompson Nov 3 '10 at 7:40

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.