[blfs-support] Comment/Question/Flame on "probably the most used admin tool", 'find'

alex lupu alupu01 at gmail.com
Mon Nov 4 15:51:39 PST 2013


On Mon, Nov 4, 2013 at 4:06 PM, Bruce Dubbs <bruce.dubbs at gmail.com> wrote:

> Bruce Dubbs wrote:
> > alex lupu wrote:
> >> I'm saddened that after all these years there's apparently no easy way
> to
> >> do something like (expressed in Artificial Intelligence :):
> >> "Find files modified (accessed, created) in a range of time (in
> minutes)"
> >> "After but Before a time in minutes ago".
> >>
> >> Most people with PhD's in "find", claim you cannot create something
> >> _simple_
> >> like,
> >>
> >> find ... -mmin -<beginofrange> -mmin +<endofrange> ...
> >>
> >> That despite of a voluminous, feature-rich and extremely detailed
> >> documentation and/or blogs.
> >> Despite various available ands, ors and the like, one can sprinkle
> >> around.
> >> Despite the clear explanations that the "-" means "after ... ago" and
> >> "+" means "before ... ago"  (or is it the other way around?  :).
> >> Despite the lack of warning that the "-" and "+" constructs do not work
> >> together.  Apparently one at a time
> >>
> >> You'd think that after the so called "old" find and the "stable" one
> >> (since
> >> 2009) something like
> >> find ... -mmin -240 [-a/-o/whatnot] -mmin +120 ...
> >> would work.
> >>
> >> Any thoughts?
> >
> > I agree with you.  The parsing of arguments uses the last value of
> > -mmin, but it seems like a -mmax argument would be useful.
>
> I spoke too quickly.
>
> find -mmin +2 -mmin -30
>
> seems to work for me.
>
> http://www.gnu.org/software/findutils/manual/html_node/find_html/Age-Ranges.html
>
> Your solution works wonderfully without fail.  Thanks.
Why wouldn't I ever thought of it ?!
This is really mystifying.  I spent all morning playing with just
this kind of solutions and failed miserably.  Thus the OP.

Two possible (circumstantial) reasons:
1.  One-hour time change here yesterday (DST -> EST).
2.  Dan's solution (covered by the PS in my OP) has been voted Best Hack
by IFTA the last three years in a row.
One would think the "find -mmin +2 -mmin -30" would get the nod instead,
if tried (and _worked_) by the millions of administrators out there all
these years.
(OTOH, as we all know, true hackers have a different sense of beauty.)

Thanks,
-- Alex

PS For people having spent the recent years under a rock:
 IFTA stands for International Find Tricks Association.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-support/attachments/20131104/6f2bf4d5/attachment.html>


More information about the blfs-support mailing list