4 ms·
Why not just find . -name "*.o" -delete ?
by BrandonM 17y ago
Why not just
find . -name "*.o" -delete
?
- michaelcampbell 17y agoThat'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(/)