link to original stack overflow post

First, run the following to establish your extended bash history file:

cat ~/.bash_history >> ~/.bash_history_extended

I then added the following to my .bashrc:

1
2
3
4
export HISTFILESIZE=
export HISTSIZE=
export HISTFILE=~/.bash_history_extended
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"

Remember to run source ~/.bashrc in any running shells/terminal windows to get the latest bash history config established.