Find recently modified files on Linux

There are times when we want to find recently modified files in a directory. We can use command line tool find on Linux or Mac for this. Here are some quick commands to do it:

Find files modified within last few minutes

Find files modified within last 30 min

$ find . -mmin -30 -type f

Find recent files modified within last 30 min and sort them also

$ find . -mmin -30 -type f -exec stat -f'%m %N' {} \; | sort -rn | awk '{print $2}' | xargs -n 1 ls -l

Find recent files modified within last 30 min with depth less than 3

$ find . -mmin -30 -type f -depth -3

Find recent files within last 10 days

$ find . -mtime -10 -type f
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments