Find Files Older Than 1 Day in Linux

Last updated on Dec 29, 2019 in Linux

In order to find files that are older than 1 day (or any number of days) you propably need files whose has last modification time, the mtime, is older than that specific date, meaning that the content has changed. However, if you are interested in files whose permissions or file name has changed, not the content, you should look for files by ctime, the last change time.

Let’s use find command for the task. First, go to the directory where you would like to commit the search:

$ find . -mtime +1
  • The . is the starting directory, i.e. the current folder
  • -mtime finds files by mtime, which is the last mofidication time of the content
  • +1 stands for files older than 1 day. Of course, you can use any number, for example, to find files older than 1 year, use +365.

If you are trying to find files whose filename or permission is changed, use the -ctime option:

$ find . -ctime +1

If you need files that has been accessed before last 1 day, check article: Find Files Accessed Before Last 24 Hours in Linux