3 ms·
It's worth noting that -delete is more efficient than the above, and indeed safer. Efficient because additional exec's are removed, for the most part find can
by acg 17y ago
It's worth noting that -delete is more efficient than the above, and indeed safer.
Efficient because additional exec's are removed, for the most part find can perform the unlink itself.
Safer because a replacement version for rm cannot be inserted into the user's path.
Before -delete was added to find I always found perl faster:
find2perl scratch -type f -size 0 -eval 'unlink' | perl
or
find2perl scratch -type f -size 0 -exec rm {} \; | perl
The last case does not actually call rm but is hard-wired to use unlink().
It may still be faster.