[UNCLASSIFIED]RE: [clug] What's the fastest way of deleting files ?

Antti.Roppola at brs.gov.au Antti.Roppola at brs.gov.au
Thu May 12 04:01:54 GMT 2005

Stephen Jenkin wrote:

> find ...|xargs /bin/rm --- should _always_ be quicker that -exec rm
> (Invokes rm least number of times, versus once per file)

I usually do this, but spaces in file names have been annoying me for
a long while when doing this to other people's data. but never enough
to fix it properly. However I just RTFM'ed and:

  find . -print0 |xargs -0 rm

The "-0" option says use null instead of white-space as a delimiter
and the "-print0" option tells find use nulls at the end of each
file name found.

Murphy says that now that I have worked around this annoyance, people
will start using some other reserved character in their file names
Probably single quotes as apostrophes.


#include <lawyer.h>

IMPORTANT - This message has been issued by The Department of Agriculture, Fisheries and Forestry (DAFF).  The information transmitted is for the use of the intended recipient only and may contain confidential and/or legally privileged material.  It is your responsibility to check any attachments for viruses and defects before opening or sending them on.  
Any reproduction, publication, communication, re-transmission, disclosure, dissemination or other use of the information contained in this e-mail by persons or entities other than the intended recipient is prohibited.  The taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.  If you have received this e-mail in error please notify the sender and delete all copies of this transmission together with any attachments.  If you have received this e-mail as part of a valid mailing list and no longer want to receive a message such as this one advise the sender by return e-mail accordingly.  Only e-mail correspondence which includes this footer, has been authorised by DAFF 

More information about the linux mailing list