[find] Find files by modification time

Created on November 30, 2026

Use -mtime to filter files by how long ago they were modified. -type f restricts both examples to regular files.

To find files modified less than seven days ago, run this command.

find . -type f -mtime -7

To find files for which more than seven whole days have elapsed, run this command.

find . -type f -mtime +7

-mtime counts 24-hour periods and rounds down. -mtime -7 matches fewer than seven periods, -mtime 7 matches exactly seven, and -mtime +7 matches eight or more.

Shell command