#Add the following 2 lines to #.bashrc file
shopt -s histappend PROMPT_COMMAND="history -a;$PROMPT_COMMAND"