Detailed explanation of the file time attribute in Centos File System

Source: Internet
Author: User

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.