If I have LESS='-FRX' as a default environment variable, how can I, as an exception to the rule, run less with only -R, ie. override/nullify -FX?


The options specified in LESS can be overridden by options on the command line. You can't however prevent less from using the options in LESS that you don't explicitly override without changing this variable.

One way to run less with a (temporarily) modified value of LESS would be to use

LESS= less -R filename

This would call less -R with an empty value in LESS.


LESS=-R less filename

which would call less with LESS set to -R only.

  • Nice! This is quite an acceptable solution! – forthrin Feb 2 '19 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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