Linux Simple Command To Find Files Based on the Timestamp

Linux Simple Command To Find Files Based on the Timestamp:
We can combine find with -mtime to search the files based on the modified timestamp


To find files which were modified 5 days ago:
find . -name ‘*.xml’ -mtime 5
To find files which were modified 5 or more days ago:
find . -name ‘*.xml’ -mtime +5
To find files which were modified less than 5 days ago:
find . -name ‘*.xml’ -mtime -5
To find files which were modified more than 2 days ago and less than 6 days ago:
find . -name “*.xml” -a “(” -mtime +2 -a -mtime -6 “)”
Similarly we can use other switches:

-amin n  File was last accessed n minutes ago.
-anewer file File was last accessed more recently than file was modified.
-atime n File was last accessed n*24 hours ago.
-cmin n File