On an ext filesystem, each file has a stored Access, Modification, and (Status) Change time associated with it - to view this information you can use stat myFile.txt; using flags within find, we can search for files that were modified within a certain time range.

To find files that have been modified within the last 2 hours:

$ find . -mmin -120

To find files that have not been modified within the last 2 hours:

$ find . -mmin +120

The above example are searching only on the modified time - to search on access times, or changed times, use a, or c accordingly.

$ find . -amin -120
$ find . -cmin +120

General format:

-mmin n : File was modified n minutes ago -mmin -n : File was modified less than n minutes ago -mmin +n : File was modified more than n minutes ago


Find files that have been modified within the last 2 days:

find . -mtime -2

Find files that have not been modified within the last 2 days

find . -mtime +2

Use -atime and -ctime for access time and status change time respectively.

General format:

-mtime n : File was modified nx24 hours ago -mtime -n : File was modified less than nx24 hours ago -mtime +n : File was modified more than nx24 hours ago

Find files modified in a range of dates, from 2007-06-07 to 2007-06-08:

find . -type f -newermt 2007-06-07 ! -newermt 2007-06-08

Find files accessed in a range of timestamps (using files as timestamp), from 1 hour ago to 10 minutes ago: