How to find files last modified yesterday recursively on terminal

Find last modified yesterday recursively

find . -type f -mtime 2

f for regular file
d for directory


How to find modifed file since yesterday (including today)

find . -type f -mtime -2


Find files last modifed 30 days ago including yesterday and today

find . -type f -mtime -30


How to find modified files more precisely

find . -mtime -2 (less than 2 days)

find . -mtime +2 (more than 2 days)

Without + or – it finds only with a modification time not less or more.


How to find modified files in last 60 minutes

find . -mmin -60 -ls

Find last 60 minutes without hidden files

sudo find . -type f \( -iname "*.*" ! -iname ".*" \) -mmin -60


How to find modified files in-between
Last 30 mins excluding last 20 mins (so only for earlier 10 mins)

find . -mmin -30 -mmin +20 -ls


Exclude some file extension

find . -mmin -30 -mmin +20 -not -name "*.db"
find . -mmin -30 -mmin +20 -not -name "*.db" -not -name "*.exe"

Leave a Comment

Your email address will not be published. Required fields are marked *