Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

filesystem limits



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




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org