bash-it/lib/history.bash

26 lines
558 B
Bash
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

#!/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
}