St_atime
Time Whenfile data is last accessed. Changedby the
Following Functions:creat (), Mknod (), pipe (),
Utime (2), Andread (2).
St_mtime
Time Whendata was last modified. Changed bythe fol-
Lowing functions:creat (), Mknod (), pipe (), utime (),
Andwrite (2).
St_ctime
Time Whenfile status is last changed. Changed by the
Following Functions:chmod (), Chown (), creat (),
Link (2), Mknod (), pipe (), unlink (2), Utime (), and
Write ().
The LS shows that the time should be mtime.
Problem description
What is the difference between a file's CTime, Mtime, and atime?
Configuration information
Workaround
The file's Access Time,atime is changed when the file is read or executed.
The Modified time,mtime of a file is changed when the file is written with changes to the contents of the file.
The file's Create Time,ctime is changed as the content of the inode changes when writing to a file, changing owner, permission, or link settings.
As a result, changing the contents of a file changes mtime and CTime, but the CTime of the file may change when the mtime has not changed-in the event that the permissions change, but the contents of the file do not change.
The LS (1) command can be used to list atime, CTime, and mtime of files.
LS-LC filename Lists the CTime of the file
Ls-lu filename Lists the atime of the file
ls-l filename Lists the mtime of the file
atime does not necessarily have to be modified after accessing the file, because: when using the Ext3 file system, the Atime information is not updated if the Noatime parameter is used on Mount. And this is Noatime canceled, does not represent the actual situation. Anyway, these three time stamp are placed in the inode. If mtime, atime modification, the inode will be changed, since the inode changed, then the CTime will be changed. Using Noatime in Mount option does not want to make too many changes to the file system and improve reading efficiency.