Insert the command shopt -s histappend in your .bashrc. This will append to the history file instead of overwriting it. Also in your .bashrc, insert PROMPT_COMMAND=""$PROMPT_COMMAND;history -a; history -n"" and the history file will be re-written and re-read each time bash shows the prompt.