Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (23 sloc) 968 Bytes
# vim: ft=sh sw=2 ts=2 expandtab
# Good information on bash history keeping
# http://mywiki.wooledge.org/BashFAQ/088
# "You anticipate the point in time where you will have accumulated so many
# commands in your history file that you will never have to type a new one."
# http://rjpower.org/wordpress/bash-isms-i-wish-i-knew-earlier/
export HISTSIZE=
export HISTFILESIZE=
# ignoring some commands from history, gotta type them again
# if mistyped
export HISTIGNORE="clear:bg:fg:exit:* --help"
# Causes history -a to be called every time a prompt will
# presented by bash, ensuring that we do not lose history
# lines.
export PROMPT_COMMAND='history -a'
shopt -s histappend # always append to history
alias hh='echo "Refresing history"; history -a; history -n'
hf(){
history | grep ${1:-"."} | tail -r -n 10000 | selecta | eval $(awk '{ $1=""; print $0 }')
}
histfreq() {
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head -n 15
}
You can’t perform that action at this time.