Java Mailing List Archive

http://www.dba.5341.com/

Home » Home (12/2007) » oracle l »

Re: RE : OT: find command on rhel4 not working with mtime

Jared Still

2006-07-12

Replies:


On 7/12/06, Marius Raicu <mariu200@yahoo.com> wrote:
Hi,
I'm on RHEL3 and I use something like this, which works

/usr/bin/find /u08/bla/bla/*.* -mtime +31 -print -exec /bin/rm {} \;


You know of course, that '-exec CMD {} \:' is evil.

For simple commands that accept a single argument, xargs is superior.

eg.  /usr/bin/find /u08/bla/bla/*.* -mtime +31 -print | xargs rm

-exec forks and executes a shell for each file, xargs does not.

Try comparing the execution times of both methods.


--
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist
©2008 dba.5341.com - Jax Systems, LLC, U.S.A.