Hack 56. Change the history file name using HISTFILE

by Ramesh

By default, history is stored in ~/.bash_history file. Add the following line to the .bash_profile and relogin to the bash shell, to store the history command in .commandline_warrior file instead of .bash_history file. I’m yet to figure out a practical use for this. I can see this getting used when you want to track commands executed from different terminals using different history file name.

  1. # vi ~/.bash_profile
  2. HISTFILE=/root/.commandline_warrior