aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/hgrep.bash
blob: 855fbcc80cbf759e4541db417c529684b1f553f8 (plain) (blame)
1
2
3
4
5
6
7
8
# Search shell history file for a pattern. If you put your whole HISTFILE
# contents into memory, then you probably don't need this, as you can just do:
#
#     $ history | grep PATTERN
#
hgrep() {
    grep "${@:?}" "${HISTFILE:?}"
}