To find files modified at least 5 days in the future, use:
find . -newermt "5 days"
The syntax for the time specification corresponds to the one for date -d
. See man find
for info on the switch named -newerXY
for more information.
It is not possible to use e.g. -mmin
to do this. It was reported as a bug against GNU find, and was solved by implementing -newerXY
in findutils 4.3.3 (~2007) as I showed above.
Apparently it was not GNU find that was used, but BusyBox.
You should then be able to create a temporary file with touch -d
and a date in the future and then use the -newer
switch for find
such as:
touch -d "+5 days" tmpfile
find . -newer tmpfile
BusyBox touch
does not support that date format, but the principle is the same and its find
supports -newer
. Creating the reference file with a correct date is left as an exercise for the reader (always convenient to write).
Thanks. My problem is that my find is old embedded BusyBox find and not binutil find. Apparently standard linux way does not work here. :( – Muxecoid – 2012-04-24T14:51:24.603
@Muxecoid: I updated my answer with some BusyBox remarks. – Daniel Andersson – 2012-04-24T15:09:57.047
This just saved me trouble on a new machine where I had done something ten hours in the future by accident (timezone offset applied to an already-offset hardware clock) and after fixing the clock a
configure
script complained about things being in the future (by an hour and a half or so still):find . -newermt '1 hour' | xargs touch -d '-9 hours'
and I can continue. :-) – Chris Morgan – 2014-05-20T15:21:22.203