Yes, you can specify exact time ranges using the find command, but it requires a combination of options. While -mtime allows you to specify days, you can use -newermt to specify exact date and time ranges.
Here's how you can do it:
-
Using
-newermt: This option allows you to find files modified after a specific date and time.find /path/to/search -newermt "2023-10-01 00:00:00" -
Combining with
! -newermt: To specify an upper limit, you can combine-newermtwith! -newermt.find /path/to/search -newermt "2023-10-01 00:00:00" ! -newermt "2023-10-02 00:00:00"
This command will find files modified on October 1, 2023, between midnight and just before midnight on October 2, 2023.
By using these options, you can effectively specify exact time ranges for file modifications.
