Created
August 3, 2016 22:36
-
-
Save rcanepa/bea682984b120ed017606caa1bd2e16c to your computer and use it in GitHub Desktop.
Recursively find pattern in files
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
grep -rnw . -e ".*\.extend" --include=\*.js | |
-r or -R is recursive, | |
-n is line number, and | |
-w stands match the whole word. | |
-l (lower-case L) can be added to just give the file name of matching files. | |
More examples | |
grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern" | |
grep --exclude=*.o -rnw '/path/to/somewhere/' -e "pattern" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment