Skip to content

Instantly share code, notes, and snippets.

@twidi
Created June 5, 2012 09:35
Show Gist options
  • Save twidi/2873899 to your computer and use it in GitHub Desktop.
Save twidi/2873899 to your computer and use it in GitHub Desktop.
bashrc settings for better history management
# don't put duplicate lines in the history and ignore lines starting by space(s)
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=50000
HISTFILESIZE=50000
### manage history http://briancarper.net/blog/248/
# add datetime to the history command output
export HISTTIMEFORMAT=" [%F %T] "
# append each command to the history file
PROMPT_COMMAND="history -a;"
# `uh` alias to update history locally
alias uh='history -n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment