Hacker News new | past | comments | ask | show | jobs | submit login

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



I 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'


But 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.


if you are piping to xargs, for love of god at least use -print0


With ag:

    ag -G java pattern




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: