3 ms·
That's fine for /this/ example because find provides that as an option. But you might want to grep for something in many files of varying depths, or run some h
by michaelcampbell 17y ago
That's fine for /this/ example because find provides that as an option. But you might want to grep for something in many files of varying depths, or run some home-brewed script on them for which find does not provide a built-in. -exec works of course, but spawns grep (or whatever) once per file; using xargs saves considerable time since it passes lots of files to 1 command.
Or, you can use zsh.
rm **/*.o
grep foo **/*.{java,sql,xml}
# Where is that blasted IBM utility?
ls **/*pmt*(x.) # list e(x)ecutable files (.) that have "pmt" in their name.
# Show me all the "Setup" dirs in my project
ls -d **/Setup(/)