Stat (Unix)

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書

stat命令,用於展示文件或文件系統的狀態。[1]

使用方法

概要

stat [OPTION]... FILE...

描述

$ stat /bin/sh
  File: ‘/bin/sh’ -> ‘bash’
  Size: 4               Blocks: 0          IO Block: 4096   symbolic link
Device: 801h/2049d      Inode: 100737165   Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:bin_t:s0
Access: 2020-01-20 10:15:57.415000000 +0900
Modify: 2019-12-02 19:16:31.683312481 +0900
Change: 2019-12-02 19:16:31.683312481 +0900
 Birth: -

欄位描述如下:[2]

輸出資訊 標籤
檔名。作為對象的軟連結而展示。 File:
檔案大小 Size:
被分配的塊(allocated blocks)的數量 Blocks:
檔案系統進行 I/O 操作的最合適塊大小 IO Block:
檔案類型 -
裝置號碼

non-device 檔案的情況下,不會列印。

Device:
索引節點(Inode)號碼 Inode:
硬連結的數量 Links:
設計檔案類型 Device type:
權限 Access:
擁有者的用戶(user)資訊 Uid:
擁有者的組(group)息 Gid:
最近訪問該檔案的日期和時間 Access:
最近修改該檔案的日期和時間。(檔案的內容) Modify:
最近訪問該檔案資訊的日期和時間。(檔案的元數據) Change:
待補充 Birth:

參考文件

  1. ^ stat(1): file/file system status - Linux man page. linux.die.net. [2020-01-20]. (原始內容存檔於2019-12-31). 
  2. ^ stat command (outputs the statuses of files and directories to the standard output) : Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide. itdoc.hitachi.co.jp. [2020-01-20]. (原始內容存檔於2020-01-31).