4 ms·
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 retu
by thestoicattack 5y 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).
- dspillett 5y agoAh, 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.