Skip to content

Instantly share code, notes, and snippets.

@bkozora
Last active April 7, 2016 13:13
Show Gist options
  • Save bkozora/38e1c3f570ca35c7bc07 to your computer and use it in GitHub Desktop.
Save bkozora/38e1c3f570ca35c7bc07 to your computer and use it in GitHub Desktop.
Bash History Modifications
##
# Customize our history
##
# Number of commands stored in current session's history
HISTSIZE=5000
# Filesize of ~/.bash_history
HISTFILESIZE=10000
# Append instead of overwrite the history
shopt -s histappend
# Ignore duplicate entries
export HISTCONTROL=ignoredups:erasedups:ignorespace
# Ignore specific commands
export HISTIGNORE="pwd:ls:ls -ltr:history"
# Automatically append command to history without requiring the session to end
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
# Display the datetime when the command was executed
HISTTIMEFORMAT="%m/%d/%y%r "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment