Skip to main content
4 of 9
history -c and -r can be combined; wewt syntax highlighting \o/
HalosGhost
  • 4.9k
  • 10
  • 37
  • 42
# avoid duplicates..
export HISTCONTROL=ignoredups:erasedups  
# append history entries..
shopt -s histappend

# After each command, save and reload history
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -cr"
Pablo R.
  • 4.8k
  • 1
  • 17
  • 2