Use -mtime option with the find command to search files based on modification time followed by the number of days. Number of days can be used in two formats. The below examples will help you to understand the search for files based on modification time.

Find files modified in last X days

Use below command to search all files and directories modified in last 30 days. Here dot (.) is used to search in current directory. And -30 defines to search files modified in last 30 day. Change this number with your search requirements. You can also customize search based on file type. Use -type followed with -f (file) or -d (directory). Below command will search for files only.

Find files modified before X days

The below command will search all files and directories modified before 30 days. Here dot (.) is used to search in current directory. And +30 defines to search files modified before 30 day. Change this number with your search preferences. Customize search pattern to search for files only using -type f. Or use -type d to search for directories.

Conclusion

This tutorial described you to find files based on modification days. You can also use more options with find command to filter more.