26 lines
558 B
Bash
26 lines
558 B
Bash
#!/usr/bin/env bash
|
||
|
||
# append to bash_history if Terminal.app quits
|
||
shopt -s histappend
|
||
|
||
# history handling
|
||
#
|
||
# Erase duplicates
|
||
# Bash History
|
||
export HISTCONTROL="ignoredups"
|
||
export HISTCONTROL=erasedups
|
||
|
||
# resize history size
|
||
export HISTSIZE=5000
|
||
|
||
export AUTOFEATURE=true autotest
|
||
|
||
# enter a few characters and press UpArrow/DownArrow
|
||
# to search backwards/forwards through the history
|
||
bind '"[A":history-search-backward'
|
||
bind '"[B":history-search-forward'
|
||
|
||
function rh {
|
||
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
|
||
}
|