Linuxstat command and inode content-differences between ctime, mtime, and atime

Source: Internet
Author: User
Linuxstat command, inode content -- differences between ctime, mtime, and atime 1. [root @ localhosttmp] stat1txtFile: '1txt & amp; 39; Size: 8 Blocks: 8 IOBlock: 4096 regularfileDevi linux stat command, inode content-ctime, mtime, atime differences 1. [root @ localhost tmp] # stat 1.txt File: '1.txt 'Size: 8 Blocks: 8 IO Block: 4096 regular fileDevice: 802 h/2050d Inode: 196617 Links: 1 Access: (0644/-rw-r --) Uid: (0/root) Gid: (0/root) Access: 21:43:54. 00000000 0 + 0800 Modify: 21:35:42. 000000000 + 0800 Change: 21:35:42. 000000000 + 0800 2. stat displays the inode content-inode contains the Object Metadata. Specifically, it includes the following content: * file byte count * file owner's User ID * file's Group ID * file's read, write, and execute permissions * file timestamp. There are three * links in total, how many file names point to the location of the inode * file data block 3. IO Block: the logical Block size is 4096 bytes Blocks: the minimum physical block size is 512, and the IO Block size is 4096, therefore, it takes up eight physical blocks. Access: atime Modify: mtime, modification time. Note that this is not the creation time, and m is not the make parameter. Change: ctime, change Time 4. how to query through ls Three times? Ls-lc filename: list the ctime ls-lu filename of the file list the atime ls-l filename of the file list the mtime of the file -- ll is displayed by default this time 5, these three time is not good difference, but the difference must be good, because many applications will consider the time, for example, when performing a synchronous backup, they will determine the time, and files later than the last backup time should be synchronized again, etc, this can also be used when files are searched for and when files are hacked. Atime: access time, which is changed when the file is read or executed. commands such as cat and vi mtime are changed when the file content is changed, such as vi ctime: change Time: when the file tags, such as attributes, users, user groups, permissions, and content, are changed, such as chmod, chown, vi 6, and timestamp) it is one of inode content. from inode, we can understand that ctime refers to the last time inode was changed, mtime refers to the last time the file content was modified, and atime refers to the last time the file was opened. 7. atime may not be modified after accessing the file, because if the noatime parameter is used during the mount operation when the ext3 file system is used, the atime information will not be updated, I just don't want filesystem to make too many modifications to improve the reading efficiency.
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.