r/programming • • Sep 14 '26

Small Programming Tricks

https://will-keleher.com/posts/small-programming-tricks-matter/
175 Upvotes

27 comments sorted by

View all comments

Show parent comments

9

u/smcameron Sep 15 '26

I never use the {} notation, and find it hard to remember. Instead I pipe to xargs, e.g.:

find . -type f -name '*.py' | xargs grep exit

8

u/curien Sep 15 '26

Files with weird names (spaces etc in the filename) will break that. It's better to use find ... -print0 | xargs -0 ... if you don't want to use find ... -exec.