Skip to content

Instantly share code, notes, and snippets.

@kevinkirkup
Created November 30, 2009 01:26
Show Gist options
  • Save kevinkirkup/245186 to your computer and use it in GitHub Desktop.
Save kevinkirkup/245186 to your computer and use it in GitHub Desktop.
Bash function to grep the command history
############################################################
# Function to grep the command history
function grep_history() {
if [ ! -z "$1" ] ; then
history | grep "$1" | grep -v histg
else
echo "Need a command to grep history for..."
fi
}
alias chg='grep_history'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment