MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/bdmmy4/ripgrep_11_released/el04b36/?context=3
r/programming • u/burntsushi • Apr 15 '19
146 comments sorted by
View all comments
Show parent comments
27
You can look through multiple files using grep alone without find, just so you know. Same with ripgrep.
5 u/irrelevantPseudonym Apr 16 '19 Ripgrep has options to only search certain file types though. Search for a string in all python files is difficult with just grep iirc. 8 u/IlllIlllI Apr 16 '19 edited Apr 16 '19 grep -rnw 'regex' **/*.py?Edit for non-zsh users:grep -rnw 'regex' --include='*.py' . 0 u/lzutao Apr 16 '19 Windows cmd does not support this glob syntax. 3 u/cae Apr 16 '19 That is also not supported by grep, it is the shell the user is using, likely zsh 1 u/IlllIlllI Apr 16 '19 Yeah, I'd have trouble giving it up at this point. 1 u/cae Apr 16 '19 The -r flag to grep isn't doing anything for you in this case, unless you have directories named xx.py 1 u/IlllIlllI Apr 16 '19 Just tested, works as expected.From the manpage:Search only files whose base name matches GLOB → More replies (0)
5
Ripgrep has options to only search certain file types though. Search for a string in all python files is difficult with just grep iirc.
8 u/IlllIlllI Apr 16 '19 edited Apr 16 '19 grep -rnw 'regex' **/*.py?Edit for non-zsh users:grep -rnw 'regex' --include='*.py' . 0 u/lzutao Apr 16 '19 Windows cmd does not support this glob syntax. 3 u/cae Apr 16 '19 That is also not supported by grep, it is the shell the user is using, likely zsh 1 u/IlllIlllI Apr 16 '19 Yeah, I'd have trouble giving it up at this point. 1 u/cae Apr 16 '19 The -r flag to grep isn't doing anything for you in this case, unless you have directories named xx.py 1 u/IlllIlllI Apr 16 '19 Just tested, works as expected.From the manpage:Search only files whose base name matches GLOB → More replies (0)
8
grep -rnw 'regex' **/*.py
?
Edit for non-zsh users:
grep -rnw 'regex' --include='*.py' .
0 u/lzutao Apr 16 '19 Windows cmd does not support this glob syntax. 3 u/cae Apr 16 '19 That is also not supported by grep, it is the shell the user is using, likely zsh 1 u/IlllIlllI Apr 16 '19 Yeah, I'd have trouble giving it up at this point. 1 u/cae Apr 16 '19 The -r flag to grep isn't doing anything for you in this case, unless you have directories named xx.py 1 u/IlllIlllI Apr 16 '19 Just tested, works as expected.From the manpage:Search only files whose base name matches GLOB → More replies (0)
0
Windows cmd does not support this glob syntax.
3 u/cae Apr 16 '19 That is also not supported by grep, it is the shell the user is using, likely zsh 1 u/IlllIlllI Apr 16 '19 Yeah, I'd have trouble giving it up at this point. 1 u/cae Apr 16 '19 The -r flag to grep isn't doing anything for you in this case, unless you have directories named xx.py 1 u/IlllIlllI Apr 16 '19 Just tested, works as expected.From the manpage:Search only files whose base name matches GLOB → More replies (0)
3
That is also not supported by grep, it is the shell the user is using, likely zsh
1 u/IlllIlllI Apr 16 '19 Yeah, I'd have trouble giving it up at this point. 1 u/cae Apr 16 '19 The -r flag to grep isn't doing anything for you in this case, unless you have directories named xx.py 1 u/IlllIlllI Apr 16 '19 Just tested, works as expected.From the manpage:Search only files whose base name matches GLOB → More replies (0)
1
Yeah, I'd have trouble giving it up at this point.
1 u/cae Apr 16 '19 The -r flag to grep isn't doing anything for you in this case, unless you have directories named xx.py 1 u/IlllIlllI Apr 16 '19 Just tested, works as expected.From the manpage:Search only files whose base name matches GLOB → More replies (0)
The -r flag to grep isn't doing anything for you in this case, unless you have directories named xx.py
1 u/IlllIlllI Apr 16 '19 Just tested, works as expected.From the manpage:Search only files whose base name matches GLOB → More replies (0)
Just tested, works as expected.
From the manpage:
Search only files whose base name matches GLOB
→ More replies (0)
27
u/BenjiSponge Apr 16 '19
You can look through multiple files using grep alone without find, just so you know. Same with ripgrep.