How to disable bash shell history in Linux

To disable bash shell history in Linux, you can use the following steps:

  1. Open the bash shell profile file:
$ nano ~/.bash_profile
  1. Add the following line to the end of the file:
unset HISTFILE
  1. Save and close the file.
  2. Log out and log back in, or open a new terminal window to apply the changes.

Note: This will only disable history for the current user. If you want to disable history for all users, you will need to edit the /etc/bashrc or /etc/bash.bashrc file, depending on your distribution.

Leave a Comment