On Thu, 7 Dec 2000, Vidiot wrote:

> >You can find and delete at the same time using
> >
> >find /tmp -mtime +15 -print | xargs rm
> >
> >Tom Churchward
>
> No need to pipe into anything, because find can run commands using exec:
>
>       find /tmp -mtime +15 -print -exec rm {} \;
>
> MB
>

The xargs method is much more efficient, as rm is run with as many
arguments as it can handle on the command line. The exec method spawns one
instance of rm for EACH file found. In the case of 10 files, no biggie. In
the base of 1000, you'll notice the difference.


Bill Carlson
-- 
Systems Programmer    [EMAIL PROTECTED]    |  Opinions are mine,
Virtual Hospital      http://www.vh.org/        |  not my employer's.
University of Iowa Hospitals and Clinics        |



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to