3 ms·
Me too. Find also has -delete, so you don't have to type -exec rm -rf '{}' ';'
by wooby 17y ago
Me too. Find also has -delete, so you don't have to type -exec rm -rf '{}' ';'
- acg 17y agoIt'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.