How to Disable History in Linux ?

Disable History
Sometimes, you may have to disable the Linux history. This article will help you know how to disable history in Linux.

Sometimes, you may have to disable the Linux history, which is not a difficult task. We can do this with the help of the “set” command. Please follow the steps given below.
The set command is an inbuilt bash command, and you can use this command to set or change the bash shell environment.

“set -o” will give you the list of features and the status.

-bash-4.3# set -o
allexport off
braceexpand on
emacs on
errexit off
errtrace off
functrace off
hashall on
histexpand on
history on
ignoreeof off
interactive-comments on
keyword off
monitor on
noclobber off
noexec off
noglob off
nolog off
notify off
nounset off
onecmd off
physical off
pipefail off
posix off
privileged off
verbose off
vi off
xtrace off


As you can see, the “history” status is “on”, which is why it records everything you type. Let’s disable history Linux.
To disable an option, you can use the command given below.

set +o


If you want to enable it later, you can use the command given below.

set -o


In this case, we can go to disable the “history”.

-bash-4.3# set -o | grep history
 history on
-bash-4.3# set +o history
-bash-4.3# set -o | grep history
 history off


See! It’s “Disabled”!

If you want to enable it again, type the following command.

set -o history


Share this post

Services to Explore

Stay up to date!

Stay up to date with the Web Hosting, Cloud and Server Management Industry News and Tutorials!

We will send you only the relevant emails, and we respect your privacy. Please review our privacy policy for more info.

Linux Management Services

Focus on your business, and let us take care of your Linux Servers!
From what you are reading, it seems you are interested in Linux and related technologies. If you have a moment to spare, please take a look at our Linux Management Services plan, which might interest you even more!
Linux Management Plan

Value-Added Services

We have services that can help you run a successful business. With us, you don't have to worry about these areas because our experts will take care of it for you.

ServerHealers uses cookies.