#!/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 '"":history-search-backward' bind '"":history-search-forward' function rh { history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head }