Main Tutorials

How to find files older than certain year or minute in Linux

In some cases, we want to find files that older than certain year , let say 1 year, we can use the -mtime +1 argument. In other hand, if we want to find files that older than certain minute, let say 1 minute, we can use -mmin +1 argument.

man find 

find the following statement

       -mmin n
              File’s data was last modified n minutes ago.

       -mtime n
              File’s  data  was  last  modified  n*24  hours ago.  See the comments for
              -atime to understand how rounding affects the interpretation of file mod?
              ification times.

Find files that older than 1 year

find . -mtime +1

Find files that older than 1 minute

find . -mmin +1

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
3 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
axel
11 years ago

lol, this post is completely wrong. -mtime is days, not year. you didn’t even read the manpage you pasted…

cale
11 years ago

You should really correct or remove this post. It contains incorrect information and may lead the stray googler to error. By the very definition you’ve posted from the man page, above, mtime represents modification n*24 hrs ago (ie, mtime represents _day_, not _year_).

suhail
14 years ago

i think you are mistaken, the:

find . -mtime +1

is for finding files which are older than 1 day.