After some digging on the web, I found the following settings useful in order to improve the situation, which I have added to my .profile
- shopt -s histappend If set, the history list is appended to the history file when the shell exits, rather than overwriting the history file.
- export PROMPT_COMMAND='history -a' Set this option to append every line to history individually
- export HISTCONTROL=ignoreboth This tells bash not to save duplicates lines in the history file
- export HISTSIZE=2000 This tells bash to save the last 2000 lines of history, instead of only the last 500