Re: find command tweak

From: Bill Thompson (bill.thompson_at_GOODYEAR.COM)
Date: 03/12/04

  • Next message: Ron Bramblett: "Re: error message when add print queue"
    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


  • Next message: Ron Bramblett: "Re: error message when add print queue"

    Relevant Pages

    • PgSp and Paging Space
      ... I have an admin here who is trying to run a fairly simple command on AIX, ... I had him run the command while I monitored the system with "topas". ... Goodyear Tire and Rubber Company ... written consent of The Goodyear Tire & Rubber Company. ...
      (AIX-L)
    • Re: The Find command for hours
      ... I also know that I could use the touch command ... Goodyear Tire and Rubber Company ... written consent of The Goodyear Tire & Rubber Company. ...
      (AIX-L)
    • Re: update_flash: Command not supported
      ... After doing that, the update_flash command worked. ... Technical Support Analyst - Sr. ... May Not Be Copied or Disseminated Without Express Consent of The Goodyear Tire & Rubber Company. ...
      (AIX-L)
    • Re: Get/find-question in script
      ... To get rid of the leading zeros you could try something like this: ... The Goodyear Tire & Rubber Co. ... Tire & Rubber Company. ... > If I run the following command, ...
      (AIX-L)
    • Re: Decommissioning some SSA disks
      ... I tried the ssa_format command before, but it didn't seem to do anything (I ... Subject: Decommissioning some SSA disks ... > the ISAL Format command to format the device. ... > Tire & Rubber Company. ...
      (AIX-L)