Atime, ctime and mtime, atime, ctimemtime
1. atime, ctime, and mtime
Atime refers to access time, that isTime when the file is read or executed(Modifying the file does not change the access time ).
Ctime is change time,File status change timeThe time when the I node of the file is modified. For example, if you modify the file attribute through chmod, The ctime is modified.
Mtime is modify time, which indicatesTime when the file content was modified.
Use stat to view the atime, ctime, and mtime of the file.
Stat/etc/passwd
File: '/etc/passwd'
Size: 1381 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768 dInode: 399683 Links: 1
Access: (0644/-rw-r --) Uid: (0/root) Gid: (0/root)
Access: 23:53:40. 096000003 + 0800
Modify: 14:16:07. 037115838 + 0800
Change: 14:16:07. 038115837 + 0800
You can also use ls to view the atime, ctime, and mtime of the file.
In general, the ls-l/etc/passwd we use indicates the modify time of the file.
Ls-lu/etc/passwd or ls-l-time = atime/etc/passwd indicates the access time of the file.
Ls-lc/etc/passwd or ls-l-time = ctime/etc/passwd indicates the change time of the file.
Touch can be used to change these three times. We will not introduce how to use touch to change atime, ctime, and mtime.
2. find.-parameter n in mtime
In find.-mtime n, n indicates 24 * n, and + n,-n, and n indicate:
+ N: greater than n
-N: less than n
N: equal to n
Find.-mtime n: File was last modified n * 24 hours ago.
The last modification takes place n * 24 hours to (n + 1) * 24 hours from the current time.
Find.-mtime + n:
The last modification takes place n + 1 days ago and is 24 hours or earlier than the current time (n + 1 ).
Find.-mtime-n:
The last modification takes place within n days and is less than n * 24 hours from the current time.