Read Time:54 Second
I recently had the necessity to use this useful command to search Linux files changed or created in the last hour (it works on Mac OS too!!)
find . -mmin -60
where
. is the search path and in this case is the folder in which you are (you can get this info by using pwd command)
together with -mmin you can combine or replace with other options like the ones below
Option | Meaning | Unit | Example |
-amin | when the file was last accessed | minutes | find . -amin -20 (file accessed in the last 20 mins) |
-atime | when the file was accessed | days | find . -atime -2 (files accessed in the last 2 days) |
-cmin | when the file was created | minutes | find . -cmin -3 (files created in the last 3 minutes) |
-ctime | when the file was created | days | find . -ctime -3 (files created in the last 3 days) |
-mmin | when the file was modified | minutes | find . -mmin -3 (files modified in the last 3 minutes) |
-mtime | when the file was modified | portion of a day | possible values are: – -1: last 24 hours – -0.5: last 12 hours – -0.25: last 6 hours |
Hope it helps!
Share this content: