bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make {} always work even outside -exec


From: Dan Jacobson
Subject: Re: make {} always work even outside -exec
Date: Thu, 12 Oct 2006 06:03:01 +0800

>> One has to do
>> $ find -type f -exec find {} ! -anewer {} \;

J> Unless I am mistaken, "find foo ! -anewer foo" always succeeds unless
J> foo is touched during the execution of find.

       -anewer file
              File was last accessed more recently than file was modified.

Does find change any of the three stat(1) times? Not for -type f at
least I'm sure, so my line is still useful.

>> because you haven't opened up restrictions on the use of {} to non
>> -exec, -ok usages:
>> $ find -type f ! -anewer {}
>> or maybe
>> $ find -type f ! -anewerself

J> To be honest, I fail to see the utility of the functionality I think
J> you are describing.  Perhaps you could explain more fully, or give a
J> more obviously useful example.

I was trying to find all the .debs in /var/cache/apt/archives that I
had just copied in via cpio, but hadn't yet installed.

Installing would update their access time, so I could use ! -cnewer (or
was it ! -anewer, I forgot) to find which ones' ctime was newer than
its access time. (So indeed ! -cnewer, but the {} idea applies to both.)

Wait,
       -cnewer file
              File's  status was last changed more recently than file
              was modified.

So what I want is -cnewerthanaccess, so there should be a more general
way to write an expression to compare any of the three stat(1) times!

-cna -coa -anm -aom ...(newer/older) ... 3 x 3 x 2 ? or perhaps just
half (newer only)... and allow {} in the target position!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]