Created
June 26, 2013 17:08
-
-
Save wigsy/5869295 to your computer and use it in GitHub Desktop.
ZSH alias for grep'ing the history command easily
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in your .zshrc add: | |
alias HG='history | grep ' | |
# reload ZSH (using my default location as an example) | |
. ~/.zshrc | |
# Now run: ``HG something_of_interest`` and your history is grepped for said interesting something. |
This only greps the very last entries though? (history 0 fixes this)
I figured this out after someone showed me cat ~/.bash_history | grep
Until now, I haven't been a big grep user... I spend way too much time in Windoze.
Thanks. I was trying like history | grep "$1". But your method is simpler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very helpful