In article <c31ed75a-0115-44fc-940d-c2956c46e...@sbcglobal.net>,
Kevin Krieser <k_krie...@sbcglobal.net> wrote:
> 
> On Jan 23, 2010, at 6:45 AM, Robert P. J. Day wrote:
> 
> > On Sat, 23 Jan 2010, Marcelo M. Garcia wrote:
> >  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.

That's what -print0 is for, together with the -0 option to xargs:

find dir1 dir2 -name '*.foo' -print0 | xargs -0 rm

Cheers
Tony
-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Reply via email to