Hacker News new | ask | show | jobs
by thestoicattack 1629 days ago
As a note,

    find . -type f -exec grep stuff {} \;
will also invoke a new grep process for every file, which can be slow. If you think find is going to return a lot of files, it is often better to use

    find . -type f -exec grep stuff {} +  # note plus sign
which will replace {} with as many filenames as allowed (all correctly quoted, etc).
1 comments

Ah, yes, the other reason not to use that form: remembering to use + instead of ; for efficiency! No point removing xargs just to add in many more invocations of the target command.