Search Linux files modified in the last hour

Views: 19
0 0
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

OptionMeaningUnitExample
-aminwhen the file was last accessedminutesfind . -amin -20 (file accessed in the last 20 mins)
-atime when the file was accesseddaysfind . -atime -2 (files accessed in the last 2 days)
-cminwhen the file was createdminutesfind . -cmin -3 (files created in the last 3 minutes)
-ctime when the file was created daysfind . -ctime -3 (files created in the last 3 days)
-mmin when the file was modified minutesfind . -mmin -3 (files modified in the last 3 minutes)
-mtimewhen the file was modified portion of a daypossible values are:
– -1: last 24 hours
– -0.5: last 12 hours
– -0.25: last 6 hours

Hope it helps!

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %
Import a docker image in kubernetes Previous post Import a docker image in kubernetes
Switch python version using pyenv Next post Switch python version using pyenv
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x