4 ms·
If you're just using find to run grep against all files then you would be better off using the recursive flag in grep instead
by laumars 9y ago
If you're just using find to run grep against all files then you would be better off using the recursive flag in grep instead
- kjeetgill 9y agoI like the composition of tools, it lets you extend your usage pretty easily. I personally run this 20 times a day: find -name '*.java' | xargs grep 'pattern'
- laumars 9y agoBut at least there you're searching for specific files. I was talking only about running a find to launch an instance of grep for every file found. That's more keystrokes to get a slower result. For what it's worth, my biggest usage of find is similar to your java example (except a different file extension). I also do do '-exec sed...') a lot too.
- zokier 9y agoif you are piping to xargs, for love of god at least use -print0
- meowface 9y agoWith ag: ag -G java pattern