Created
June 5, 2012 09:35
-
-
Save twidi/2873899 to your computer and use it in GitHub Desktop.
bashrc settings for better history management
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
# 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