On 08/07/07, Peter Chubb <[EMAIL PROTECTED]> wrote:
Zhasper> find . -name "<junkfile>" -print0 | xargs -0 rm Actually lighter weight, less forking less execing, because this version runs two procsses only, rather than a new invocation of rm for each file found.
It runs at least three processes if it finds any file - "rm" is forked from xargs (unless xargs is smart enough to save the fork on end of input?) But anyway - you can save yourself xargs in this case: $ find -name "<junkfile>" -delete should do the trick. (It's funny what you can find from reading the various GNU utilities manual pages (especially while trying to help people on Linux users mailing list to troubleshoot stuff), I used to do recursive grep with "find | xargs grep" until I learned about "grep -r", now I can stop using "find | xargs rm" because I learned about "find ... -delete"). Cheers, --Amos -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
