Three kinds of timestamps in Linux basic learning -9.7-linux

Source: Internet
Author: User

1, three kinds of time correspondence relation table

Column Column column

Accessing Time Access Atime

Modification Time Modify Mtime

State Change time Changes CTime

2. How to view three timestamp of file file

Stat filename

3, three kinds of time stamp explanation

Access time: Read the contents of the file once, this time will be updated. such as more, cat and other commands. LS, stat command does not modify Atime

Modification time: The modified time is the last time the file content was modified. For example: Save the file after vim operation. This is the time ls-l listed.

[Email protected] ~]# stat oldboy.txt

File: ' Oldboy.txt '

size:69 blocks:8 IO block:4096 Regular file

device:803h/2051d inode:130137 links:1

Access: (0644/-rw-r--r--) Uid: (0/root) Gid: (0/root)

access:2017-11-11 08:33:41.661983311 +0800

modify:2017-11-11 08:32:43.505972876 +0800

change:2017-11-11 08:32:43.505972876 +0800

[Email protected] ~]# >oldboy.txt

[Email protected] ~]# stat oldboy.txt

File: ' Oldboy.txt '

size:0 blocks:0 IO block:4096 Regular empty file

device:803h/2051d inode:130137 links:1

Access: (0644/-rw-r--r--) Uid: (0/root) Gid: (0/root)

access:2017-11-11 08:33:41.661983311 +0800

modify:2017-11-11 21:01:21.249962087 +0800

change:2017-11-11 21:01:21.249962087 +0800

State change time. Is the time that the Inode node of the file was last modified, and the file properties are modified by the chmod, Chown command, and the time is updated.

[Email protected] ~]# stat oldboy.txt

File: ' Oldboy.txt '

size:0 blocks:0 IO block:4096 Regular empty file

device:803h/2051d inode:130137 links:1

Access: (0644/-rw-r--r--) Uid: (0/root) Gid: (0/root)

access:2017-11-11 08:33:41.661983311 +0800

modify:2017-11-11 21:01:21.249962087 +0800

change:2017-11-11 21:01:21.249962087 +0800

[Email protected] ~]#

[email protected] ~]# ll Oldboy.txt

-rw-r--r--1 root root 0 Nov 21:01 oldboy.txt

[Email protected] ~]# LN oldboy.txt oldboy.txt-hard

[email protected] ~]# ll Oldboy.txt

-rw-r--r--2 root root 0 Nov 21:01 oldboy.txt

[Email protected] ~]# stat oldboy.txt

File: ' Oldboy.txt '

size:0 blocks:0 IO block:4096 Regular empty file

device:803h/2051d inode:130137 Links:2

Access: (0644/-rw-r--r--) Uid: (0/root) Gid: (0/root)

access:2017-11-11 08:33:41.661983311 +0800

modify:2017-11-11 21:01:21.249962087 +0800

change:2017-11-11 21:03:09.906964526 +0800

1) mtime file content last modified on 2) CTime file status last changed 3) atime file content last access time exercises:

1. How do I check the timestamp in Linux?

2. Time stamp classification (three types)

Three kinds of timestamps in Linux basic learning -9.7-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.