find mtime not the same as ls mtime?

VirginSnow at vfemail.net VirginSnow at vfemail.net
Fri Mar 13 14:03:57 EDT 2009


> Date: Fri, 13 Mar 2009 12:36:39 -0400
> From: Tom Buskey <tom at buskey.name>

> > >> find . -mtime 60
> > >
> > >Doesn't mtime's arg mean that many days ago?  So you're asking find
> > >to mention files 60 days old, I think.   Is that what you intended?
> >
> > I actually should have said, "So you're asking find to mention files
> > last modified 60 days ago"
> >
> 
> And I don't think it will find files modified 59 days or 61 days ago.
> 
> find . -mtime +60 would find files > 60 days
> find . -mtime -60 is <60 days.

Yes.  However, there's still a caveat: GNU find has a non-intuitive
way of defining what times qualify as being "N days ago".  Even with +
or -, it may not return what you expect.  "info find" has all the
details (though I've never really understood the details, myself!).


More information about the gnhlug-discuss mailing list