6 ms·
`find |grep -i ...` and `find -type f |xargs grep -i ...` have become old favourites. This seems like an interesting system, provided you don't have more categ
by andyjpb 6y ago
`find |grep -i ...` and `find -type f |xargs grep -i ...` have become old favourites.
This seems like an interesting system, provided you don't have more categories than you can easily remember.
If you use it in a team setting, there must not be more categories than the team as a whole can remember which is, perhaps counter-intuitively, fewer than you can probably remember on your own.
As with all classification systems, one should beware the Celestial Emporium of Benevolent Knowledge: https://en.wikipedia.org/wiki/Celestial_Emporium_of_Benevolent_Knowledge https://en.wikipedia.org/wiki/Celestial_Emporium_of_Benevole... or be doomed to repeat it.
- merlinscholz 6y agoAny 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 ...`?