filesystem limits

David Kramer david at thekramers.net
Sun Jan 30 11:47:49 EST 2005


James R. Van Zandt wrote, On 01/30/2005 11:33 AM:
> Gregory Boyce <gboyce at badbelly.com> wrote:
> 
>>On Tue, 11 Jan 2005, Bill Holt wrote:
>>
>>
>>>woops...
>>>find . -name '*' | xargs rm
>>
>>I would normally do:
>>
>>find . -name '*' -exec rm {} \;
> 
> 
> Both of these would fail if filenames have spaces.  I suggest
> 
>    find . -name '*' -exec rm "{}" \;
> 
> 	  - Jim Van Zandt


You can solve the space-in-name problem by using
find . -name '*' -print0 | xargs -0 rm
Which will use \0 to delimit filenames.

However, the -exec method has the advantage of not being limited by the 
maximum number of command line parameters and line length.

-- 
DDDD
DK KD
DKK D  Bush/Cheney '04:
DK KD  Thanks for not paying attention.
DDDD



More information about the Discuss mailing list