Created
December 9, 2015 00:12
-
-
Save bmount/f9c38d29f6542290ebb8 to your computer and use it in GitHub Desktop.
Keep all of your shell history forever
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
HOSTNAME_SHORT="${HOSTNAME%%.*}" | |
his () | |
{ | |
grep -r "$@" ~/.history | |
history | grep "$@" | |
} | |
export HISTFILESIZE=10000 | |
export HISTFILE="${HOME}/.history/$(date -u +%Y/%m/%d.%H.%M.%S)_${HOSTNAME_SHORT}_$$" | |
mkdir -p $(dirname $HISTFILE) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment