The meaning of CTime atime mtime under Linux

Source: Internet
Author: User

Read a lot of articles are basically reproduced the party's works to review all the information and hands-on test on the basis of a brief summary

You can first use the STAT command to query the file's inode information, including CTime Atime mtime


1. Easy to understand documents:

A file's access Time,atime is a change to any inode access that changes 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 change time,ctime of a file is changed as the content of the Inode changes when you write to the file, change the owner, permissions, or link settings. As long as the content of the stat is changed, changes will occur. Changes in Mtime inevitably lead to ctime changes.


2. Folder:


The folder's access Time,atime is changed when the file is read or executed (we only CD into a directory and then CD: will not cause atime changes, but LS a bit different).

The folder's Modified Time,mtime is a new file in the folder, * * * will change (if you just change the contents of the file will not cause mtime changes, in other words if the results of ls-f <directory> changes mtime will be refreshed. There may be someone to argue: I enter DD This folder vi a file and then exit, Ls-f <directory> before and after the results have not changed but the folder Mtime changed ... This is a good idea. The VI command creates a ". File.swp" temporary file in this folder when editing a file, and the file is * * * * * with the exit of VI ... This leads to a change in mtime [auxten:p] You can experiment with nano-modified files.

The change time,ctime of the folder is basically the same as the file's CTime, which embodies the change time of the inode.


One more thing to add: Mount-o noatime (mount-o remount,atime/can re-mount the root directory online) can choose not to log the file atime changes, what does that mean? When you create this file, the atime of the file is fixed, unless you use touch or touch-a to force the atime of the file to be refreshed. This can improve the read and write performance of the file system to a certain extent, especially the Web site in this system in Fstab add Noatime is a good idea O (∩_∩) o


Like my/dev/sda3/ext3 noatime 0 1


This article is from the "Reboot DevOps Development" blog, please be sure to keep this source http://opsdev.blog.51cto.com/2180875/1560527

The meaning of CTime atime mtime under Linux

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.