[[email protected] ~]# stat [選項]檔名或目錄名
選項:
[[email protected] ~]# stat anaconda-ks.cfg
File: "anaconda-ks.cfg"
#檔名
Size: 1170 Blocks: 8 IO Block: 4096 普通檔案
#檔案大小 占用的block數 塊大小 檔案型別
Device: 803h/2051d Inode: 130834 Links: 1
#i節點號 連結數
Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)
#許可權 所有者 所屬組
Access: 2016-05-06 23:31:41.396893415 +0800
#存取時間
Modify: 2016-05-06 23:31:41.396893415 +0800
#資料修改時間
Change: 2016-05-06 23:31:41.411006937 +0800
#狀態修改時間
[[email protected] ~]#stat -f anaconda-ks.cfg
File: "anaconda-ks.cfg"
ID: c05ad05e0e3b0580 Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 5045314 Free: 4356956 Available: 4100662 Inodes: Total: 1283632 Free: 1192731
[[email protected] ~]# date
2016年05月07日星期六01:40:49 CST
[[email protected] ~]# stat bols
File: "bols"
Size: 0 Blocks: 0 IO Block: 4096 普通空檔案
Device: 803h/2051d Inode: 130829 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2016-05-07 00:10:23.794319970 +0800
Modify: 2016-05-07 00:10:23.794319970 +0800
Change: 2016-05-07 00:10:23.794319970 +0800
#這些時間都是最後一次修改檔案的時間,並不是當前時間
[[email protected] ~]# cat bols
[[email protected] ~]# stat bols
File: "bols"
Size: 0 Blocks: 0 I0 Block: 4096 普通空文
Device: 803h/2051d Inode: 130829 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid:(0/ root)
Access: 2016-05-07 01:41:08.202924900 +0800
#只有存取時間變為了cat命令的執行時間,其他兩個時間沒有改
Modify: 2016-05-07 00:10:23.794319970 +0800
Change: 2016-05-07 00:10:23.794319970 +0800
[[email protected] ~]# echo 9527> bols
[[email protected] ~]# stat bols
File: "bols"
Size: 6 Blocks: 8 I0 Block: 4096 普通檔案
Device: 803h/2051d Inode: 130829 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2016-05-07 01:41:08.202924900 +0800
#這個時間還是上次修改時間
Modify: 2016-05-07 01:42:42.459614017 +0800
Change: 2016-05-07 01:42:42.459614017 +0800 #而這兩個時間變為了 echo 命令的執行時間
[[email protected] ~]# chown nobody bols
[[email protected] ~]# stat bols
File: "bols"
Size: 6 Blocks: 8 10 Block: 4096 普通檔案
Device: 803h/2051d Inode: 130829 Links: 1
Access: (0644/-rw-r-r-) Uid: ( 502/ nobody) Gid: ( 0/root)
Access: 2016-05-07 01:41:08.202924900 +0800
Modify: 2016-05-07 01:42:42.459614017 +0800
# 前兩個時間還是之前修改的時間
Change: 2016-05-07 01:43:09.676860399 +0800
#而狀態修改時間變為了chown命令的執行時間
[[email protected] ~]# touch bols
[[email protected] ~]# stat bols
File: "bols"
Size: 6 Blocks: 8 10 Block: 4096 普通檔案
Device: 803h/2051d Inode: 130829 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 502/ nobody) Gid: ( 0/root)
Access: 2016-05-07 01:54:14.466809236 +0800
Modify: 2016-05-07 01:54:14.466809236 +0800
Change: 2016-05-07 01:54:14.466809236 +0800
#三個時間都會變為touch命令的執行時間