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

3 comments on “How to find files older than certain year or minute in Linux

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

    Reply
  2. 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_).

    Reply
  3. i think you are mistaken, the:

    find . -mtime +1

    is for finding files which are older than 1 day.

    Reply

Leave a Comment

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