From 1729f6aeb09dc14b0139ec458648c8beb706a138 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 27 Jun 2014 10:51:15 +1200 Subject: Alias to search HISTFILE --- bash/bashrc.d/hgrep.bash | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 bash/bashrc.d/hgrep.bash (limited to 'bash/bashrc.d/hgrep.bash') diff --git a/bash/bashrc.d/hgrep.bash b/bash/bashrc.d/hgrep.bash new file mode 100644 index 00000000..0c31a213 --- /dev/null +++ b/bash/bashrc.d/hgrep.bash @@ -0,0 +1,9 @@ +# 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:?}" +} + -- cgit v1.2.3