Last active
June 13, 2019 07:50
-
-
Save omurphy27/0f81bd9ccccf669ceb8f8b1a2268f41d to your computer and use it in GitHub Desktop.
Oh My ZSH Recursive Case-insensitive Grep with common File / Folder Exclusions and Line Numbers - Bash Function and alias shortcut for zshrc file
This file contains 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
# add any other filename endings you wish to exclude | |
function mygrep { | |
grep -inrF "$1" --exclude-dir={node_modules,vendor,.git,.svn} --exclude=\*.{min.js,min.css,map,swp,swn,swo} . --color; | |
} | |
# fire the above function in your terminal by doing the below | |
# in the directory you wish to recursively grep through | |
mygrep function_name_to_grep | |
# or wrap your search term in quotes | |
mygrep 'string to search for' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment