關於LINUX系統的三種時間戳記的詳細說明,linux三種詳細說明

來源:互聯網
上載者:User

關於LINUX系統的三種時間戳記的詳細說明,linux三種詳細說明

Linux系統將時間標記分三類:

atime(Access time):檔案上次被讀取的時間。

ctime(statusChange time):檔案的屬性或內容上次被修改的時間。

mtime(Modified time):檔案的內容上次被修改的時間。

下面我將用實驗給大家講解一下:

[root@localhost ~]# touch a.txt ==》建立檔案a.txt

[root@localhost ~]# stat a.txt ==》查看時間戳記

File: "a.txt"

Size: 0 Blocks: 0 IO Block: 4096 普通空檔案

Device: fd00h/64768dInode: 674903 Links: 1

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

Access: 2018-03-10 13:29:04.130157512 +0800

Modify: 2018-03-10 13:29:04.130157512 +0800

Change: 2018-03-10 13:29:04.130157512 +0800

[root@localhost ~]# echo 1>> a.txt ==》向檔案a.txt追加內容

[root@localhost ~]# stat a.txt ==》查看追加內容後的檔案時間戳記

File: "a.txt"

Size: 1 Blocks: 8 IO Block: 4096 普通檔案

Device: fd00h/64768dInode: 674903 Links: 1

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

Access: 2018-03-10 13:29:04.130157512 +0800

Modify: 2018-03-10 13:29:19.351159892 +0800==》時間戳記改變

Change: 2018-03-10 13:29:19.351159892 +0800 ==》時間戳記改變

[root@localhost ~]# chmod +x a.txt ==》修改檔案a.txt的許可權

[root@localhost ~]# stat a.txt ==》查看修改許可權後的檔案時間戳記

File: "a.txt"

Size: 1 Blocks: 8 IO Block: 4096 普通檔案

Device: fd00h/64768dInode: 674903 Links: 1

Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)

Access: 2018-03-10 13:29:04.130157512 +0800

Modify: 2018-03-10 13:29:19.351159892 +0800

Change: 2018-03-10 13:29:42.156153774 +0800==》時間戳記改變

[root@localhost ~]# cat a.txt ==》查看檔案a.txt

 

[root@localhost ~]# stat a.txt ==》查看檔案a.txt的時間戳記

File: "a.txt"

Size: 1 Blocks: 8 IO Block: 4096 普通檔案

Device: fd00h/64768dInode: 674903 Links: 1

Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)

Access: 2018-03-10 13:30:00.010155999 +0800 ==》時間戳記改變

Modify: 2018-03-10 13:29:19.351159892 +0800

Change: 2018-03-10 13:29:42.156153774 +0800

[root@localhost ~]# vim a.txt ==》向檔案a.txt新增內容

daskhdjkas

"a.txt" 1L, 11C 已寫入

[root@localhost ~]# stat a.txt ==>查看檔案a.txt的時間戳記

File: "a.txt"

Size: 11 Blocks: 8 IO Block: 4096 普通檔案

Device: fd00h/64768dInode: 674908 Links: 1

Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)

Access: 2018-03-10 13:30:34.652158960 +0800==》時間戳記改變

Modify: 2018-03-10 13:30:34.652158960 +0800==》時間戳記改變

Change: 2018-03-10 13:30:34.653158940 +0800==》時間戳記改變

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.