Every time I search for a term in less
, it stores my search in the file .lesshst
. How can I stop this behavior?
Ubuntu – How to stop less from storing history
less
less
Every time I search for a term in less
, it stores my search in the file .lesshst
. How can I stop this behavior?
Best Answer
Open a terminal and create a file
.lesskey
, in your home folder and append the following to it:If you already have the file
.lesshst
in your home folder, then delete it and type the commandYou should get any errors here. This will not store any history of
less
from now on, until you change the.lesskey
file.From the man page of less:
EDIT:
From the comments, I found a better way to prevent having a history file for less.
In the
.lesskey
file in the home folder, append this:or
If you put this in your
~/.bashrc
file, this will work, but will have a lower precedence if you have other values in your.lesskey
file for the same variables.You may want to have a look at this:
less
more friendly