# Avoid duplicates, ignore two characters commands and those ones which starts with # a space. Preserve history in multiple terminal windows. export HISTCONTROL=ignoredups:erasedups export HISTCONTROL=ignoreboth export HISTCONTROL=ignorespaces export HISTIGNORE=?? # After each command, append to the history file and reread it export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" shopt -s histappend shopt -s checkwinsize