Created
January 22, 2013 02:52
-
-
Save arq5x/4591687 to your computer and use it in GitHub Desktop.
Unique BASH history
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
HISTCONTROL="erasedups" | |
export HISTCONTROL |
For the lazy here is the combined power of @arq5x and @kasperdanielhansen:
shopt -s histappend
shopt -s cmdhist
bind '"\e[B": history-search-forward'
bind '"\e[A": history-search-backward'
HISTCONTROL="erasedups"
export HISTCONTROL
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should add
shopt -s histappend
shopt -s cmdhist
bind '"\e[B": history-search-forward'
bind '"\e[A": history-search-backward'
(on top of erasedups). This is even better. Say you type
# ls
and press UP. Then UP cycles through commands starting with ls, not all commands.