Server Fault is a question and answer site for system and network administrators. 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

The question is based on this answer.

How can you set the -R in your LESS environment variable?

share|improve this question
up vote 10 down vote accepted

Taken from the manpage:

Options are also taken from the environment variable "LESS".  
For example, to avoid  typing  "less  -options  ..."
each time less is invoked, 

you might tell csh:

   setenv LESS "-options"

or if you use sh:

   LESS="-options"; export LESS

If you are using Bash which is the default on a variety of distributions we can therefore do:

export LESS="-R"

If you want to make this permanent across shell/login sessions then you need to add the command(s) above to the appropriate file, with Bash as the example again you'd open up $HOME/.bashrc with a text editor and drop in the export command. This means each time Bash invokes it will run the export command, setting your Less preferences.

Hope that helps :-)

share|improve this answer
Thank you for your answer! – Masi Jul 4 '09 at 16:09
LESS environment variable also works in Unxtools port of Less to Windows. – Richard Jul 4 '09 at 16:29

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.