3 ms·
Any reason to use `find -type f |xargs grep -i ...` instead of `grep -i -r "whatever" .`?
by merlinscholz 6y ago
Any reason to use `find -type f |xargs grep -i ...` instead of `grep -i -r "whatever" .`?
- andyjpb 6y agoI usually put a few paths in between "find" and "-type", use the other predicates of "find" and often rewrite if from a just executed `find ... | grep`. One particular modification is to extend the pipeline between the "find" and the "xargs" to filter the file list, especially `grep -v .git` ;-)
- bostonvaulter2 6y agoCouldn't you use `rg` (ripgrep) instead `find -type f |xargs grep -i ...`?