Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unified history in bash (with a focus on OS X)
# You need to add these two lines to your bash environment
shopt -s histappend
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
# In most *nix variants, that means adding them to your .bashrc file.
# However, on OS X, the default session for Terminal is a login session,
# meaning that it doesn't run .bashrc.
# As such, you'll need to include these commands into your
# .profile or .bash_profile (whichever you have/want).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment