1. 程式人生 > >stat---顯示檔案的狀態資訊

stat---顯示檔案的狀態資訊

stat命令用於顯示檔案的狀態資訊。stat命令的輸出資訊比ls命令的輸出資訊要更詳細。

語法

stat(選項)(引數)

選項

-L:支援符號連線;
-f:顯示檔案系統狀態而非檔案狀態;
-t:以簡潔方式輸出資訊;
--help:顯示指令的幫助資訊;
--version:顯示指令的版本資訊。

引數

檔案:指定要顯示資訊的普通檔案或者檔案系統對應的裝置檔名。

例項

[[email protected] ~]# ls -l myfile
-rw-r--r-- 1 root root 0 2010-10-09 myfile

[[email protected] ~]# stat myfile
file
: “myfile” Size: 0 Blocks: 8 IO Block: 4096 一般空檔案 Device: fd00h/64768d Inode: 194805815 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2010-12-12 12:22:35.000000000 +0800 Modify: 2010-10-09 20:44:21.000000000 +0800 Change: 2010-10-09 20:44:21.000000000 +0800 [[email protected] ~]# stat -f myfile File: "myfile"
id
: 0 Namelen: 255 type: ext2/ext3 Block size: 4096 Fundamental block size: 4096 Blocks: Total: 241555461 free: 232910771 Available: 220442547 Inodes: Total: 249364480 Free: 249139691 [[email protected] ~]# stat -t myfile myfile 0 8 81a4 0 0 fd00 194805815 1 0 0 1292127755 1286628261 1286628261 4096