Re: find command tweak
From: Bill Thompson (bill.thompson_at_GOODYEAR.COM)
Date: 03/12/04
- Previous message: cbaker_at_GOODYEAR.COM: "xlfrte 8.1.1.0 XL Fortran for AIX Runtime Env."
- Maybe in reply to: Bob.Kelley_at_BRINKSINC.COM: "find command tweak"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 12 Mar 2004 15:07:58 -0500 To: aix-l@Princeton.EDU
One note of caution - If you are processing lots of files then this syntax:
find /archivefiles -type f -mtime +2 ! -name "*.Z" -print -exec compress {}
\;
is very inefficient as it has to spawn another process for each file it
encounters.
For processing a large group of files, this will run much faster:
find /archivefiles -type f -mtime +2 ! -name "*.Z" -print | xargs compress
Bill Thompson
Sr UNIX Systems Administrator
The Goodyear Tire & Rubber Co.
Contains Confidential and/or Proprietary Information
May Not Be Copied or Disseminated Without Express Consent of The Goodyear
Tire & Rubber Company.
AIX-L Archives: http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2
----- Original Message -----
From: "Kevin Crocker" <kevin@TEQ.NET>
Newsgroups: bit.listserv.aix-l
To: <aix-l@Princeton.EDU>
Sent: Friday, March 12, 2004 2:41 PM
Subject: Re: find command tweak
> At 01:29 PM 03/12/2004 -0600, you wrote:
> >Thanks for that. Now how to go about the compress on all the files
except
> >*.Z and output from that find command??? any slick ideas?
> >
> >Bobby Kelley Jr.
>
> >what about ...
> >
> > find /archivefiles -type f -mtime +2 ! -name "*.Z" -print
> >
> >
> >Assuming you're using 'compress' ... change to *.gz for gzip, etc.
> >
> >Bruce T. Harvey
>
>
> How about adding to the command something like:
>
> find /archivefiles -type f -mtime +2 ! -name "*.Z" -print -exec compress
> ... {} \;
>
> of course using the proper form of the compress command
> not very efficient but it should work
>
> Kevin
- Previous message: cbaker_at_GOODYEAR.COM: "xlfrte 8.1.1.0 XL Fortran for AIX Runtime Env."
- Maybe in reply to: Bob.Kelley_at_BRINKSINC.COM: "find command tweak"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|