In the Linux operating system, each file has a lot of time parameters, of which three are compared to the main, respectively, Ctime,atime,mtime
Atime last access time, such as LS, more etc, but chmod, chown, LS, stat, etc. will not be modified for some time, using Ls-utl can be viewed in this chronological order;
CTime the last state modification time, such as chmod, Chown and other state time changes but the modification time will not change, using stat file can be viewed;
Mtime Last content modification time, such as VI save, etc., change time changes, Atime and CTime also corresponding change
-ctime-n find files that have been modified within the current n*24h
-ctime n finds files that have been modified in the *24h (n+1) before the current n*24h
-ctime +n Find files that have been modified before (n+1) *24h
Common examples:
--Find files that were modified two days ago:
Find. -type f-mtime-2
--Find files that have been modified within 3 days:
Find-ctime-3
--delete files with a state modification time of more than 6 days in the/data/backup directory:
Find/data/backup-ctime +6-exec rm-f {} \;
--Delete the empty folder under the/data/backup directory while outputting the correct and error messages to null:
Find/data/backup-type d-empty-exec rmdir {} \; >/dev/null 2>&1
--Look for the find command that is longer than 6 days and is an empty file:
Find./-type d-empty-ctime +6
--Find files in the/home/admin directory with the modified time within 1 days
Find/home/admin-mtime-1
--Find files with the file name ". txt" in the/home/admin directory with the modified time within 1 days
Find/home/admin-name *.txt-mtime-1
The ctime,atime,mtime of the Linux find