Linux: Find files changed or modified within xx day or older than xx day

One of the utility commands of Linux that you should know in the first day of your Linux learning seminar is find.

To search recursively in the directory somedir for files changed / created / modified within 1 day:

find somedir -ctime -1

Or within 5 days:

find somedir -ctime -5

To search recursively in the directory somedir for files changed changed / created / modified more than 1 days ago:

find somedir -ctime +1

Or more than 5 days ago:

find somedir -ctime +5

To search recursively in the directory somedir for files modified within 1 day:

find somedir -mtime -1

To search recursively in the directory somedir for files modified more than 1 days ago:

find somedir -mtime +1

Or more than 2 weeks ago:

find somedir -mtime +14

2 thoughts on “Linux: Find files changed or modified within xx day or older than xx day”

  1. Using this, I will try to find which images have been uploaded recently(within 7 days), by my users. And may be their size also.

    find /public_html/upload/ -regex “\.gif|\.png|\.jpg|\.jpeg” -mtime -7

    Reviews welcome.

  2. Pingback: Find out Files modified within the Last x Days in Linux | Shanghai Web Hosting

Comments are closed.

Scroll to Top