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

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

3 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
axel
13 years ago

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

cale
13 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
16 years ago

i think you are mistaken, the:

find . -mtime +1

is for finding files which are older than 1 day.