Time Attributes of linux Files
Linux File time attributes include access time, modification time modifed time, and change time.
File access time
After a file is created, the file has the same access time, modification time modifed time, and change time. However, after some changes are made to the file, the time may change.
File access time, that is, the file content is read. If the file is viewed, the File Viewing Time is updated. For example, after cat, more, and less operations, the file access time is updated.
The following uses ls to display the file modification time modifed time by default.
Use the stat command to view more precise time attribute information
We can see that the file access time is 17:07:15. 000000000 + 0800. Let's see the content of this file less. Exit after less. We can see that the access time attribute of this file has changed.
File modification time modifed time
The modification time of the file is the modification time of the file content. For example, after modifying the file content through vim or emacs, or appending other methods, the file modification time will change.
The following example adds and modifies the file content, and the modification time of the file changes accordingly.
File change time
The file change time is the change time of other attributes of the file. For example, the file access time is updated when the attributes of files (ignoring changes in the file access time attribute and file modification time attribute) are changed through chmod, chown, ln, and so on. The chmod and chown update files are brand new, and the ln Update file's soft and hard link property information.
The following example creates a hard link to change the File Change Time: