8
3
How can I use find
to select files that have been written and not modified in the last minute?
I know I can do it the other way around, find files modified in the last 60 seconds with -mtime -60s
, but I want the ones that haven't been modified in the last 60 seconds.
I use Linux and get this error if I use seconds:
find ??/ -mtime +60s -name blah.tsv
find: invalid argument `+60s' to `-mtime'
2Strictly speaking,
+60
is not the opposite of-60
, for the same reason less than is not the opposite of greater than: Both exclude the exact value they compare to. But your question does not indicate which behavior you want, exactly. – Daniel Beck – 2012-01-27T16:56:14.027This isn't exactly the same indeed, since ! reverts the original "query". But agreed, the OP doesn't specify what he wants. – Karolos – 2012-01-27T17:02:48.593
The day after, the OP stated it is on Linux, not Mac OS X. If that would have changed the answer, can you update it? – Peter Mortensen – 2012-09-09T12:43:25.800
1Yeah, this doesn't work on Linux. At least RHEL 5.6. SiegeX's response below does work, however. – MattPark – 2013-01-09T19:07:53.583
@khaki54 Yeah, it's a bit confusing. While the user states that he uses Linux in an edit, he/she uses OS X/BSD find syntax in the second paragraph to the question ("I know I can do … with
-mtime -60s
") and has accepted this as the best answer... – Daniel Beck – 2013-01-09T19:55:23.1632This doesn't work on CentOS. As supposed it works in Mac OS X – trante – 2013-10-29T18:45:18.150