Last active
January 3, 2018 18:47
-
-
Save pulkitsinghal/e634c08490432600c78bff561d887674 to your computer and use it in GitHub Desktop.
combine find and grep
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
# (a) ignore certain folders | |
# like: `node_modules, .cache, .cordova, .heroku, .a127, .npm` etc. | |
# (b) look in package.json only | |
# (c) find case-insensitve matches to the word: commit | |
# (d) `-o` means "OR" ... for example, given: `expr1 -o expr2`, expr2 is not evaluated if expr1 is true. | |
find ~/ \( \ | |
-name node_modules \ | |
-o -name '.cache' \ | |
-o -name '.cordova' \ | |
-o -name '.heroku' \ | |
-o -name '.a127' \ | |
-o -name '.npm' \ | |
\) -prune \ | |
-o -name "package.json" -exec grep -i --color -Hn "commit" {} 2>/dev/null \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment