When you use the find command, you often use its -name or -xtime. Let's talk about his xtime here.
find / -mtime +7 、find / -mtime -7、find / -mtime 7
UNIX/Linux filesystems have three timestamps for each file:
- Access time (-atime/day, -amin/minute): The last access time of the user.
- Modification time ( -mtime/day, -mmin/minute): The last modification time of the file.
- Change time (-ctime/day, -cmin/minute): The last modification time of file data elements (such as permissions, etc.).
For timestamps, there will also be three time points +day, -day, and day as shown below:
Search all files that have been accessed in the last three days find . -type f -atime -3 Search for all files accessed exactly three days ago find . -type f -atime 3 Search all files that have been accessed over three days find . -type f -atime +7 Search all files with access time longer than 10 minutes find . -type f -amin +10 Find all files with longer modification time than file.log find . -type f -newer file.log