Re: The directory that I am trying to clean up is huge

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



On Jan 23, 2010, at 6:45 AM, Robert P. J. Day wrote:

> On Sat, 23 Jan 2010, Marcelo M. Garcia wrote:
> 
>> Robert Heller wrote:
>>>> 
>>>> -bash: /usr/bin/find: Argument list too long
>>> 
>>> 'man xargs'
>>> 
>>> find <mumble> -print | xargs rm
>>> 
>> Hi
>> 
>> Just curious. What is the difference between the command above and "find
>> <numble> -exec rm -f {} \;" ?
> 
>  the find ... -exec variation will invoke a new "rm" command for
> every single file it finds, which will simply take more time to run.
> beyond that, the effect should be the same.


Unless there are files or directories with spaces in them, in which case the xargs variant can fail.

It is likely the original poster either did
find * ...
or find . -name *
and the bash shell still expanded the arguments.  He was on the right track using the find command, but it wasn't used right.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux