Created
June 12, 2017 01:08
-
-
Save hyfen/a866fc010bbc4deedb3d0a360a755f88 to your computer and use it in GitHub Desktop.
Save unlimited bash history in OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# save history to ~/.bash_history as soon as command is run | |
export PROMPT_COMMAND='history -a' | |
# save unlimited history | |
# osx doesn't seem to respect =-1 or = options | |
export HISTSIZE=9999999999 | |
export HISTFILESIZE=999999999 | |
# osx doesn't actually respect this and it'll fall back to unix timestamp (which we want) | |
export HISTTIMEFORMAT="%d/%m/%y %T " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this gist.
We can do this to keep the existing PROMPT_COMMAND,