每天一個Linux 命令 - stat

stat

stat file/dir

功能 : 顯示inode內(nèi)容
Colors 文件的詳細信息

Colors 文件的詳細信息
cc@MyLinux:~$ stat Colors 
  File: 'Colors'
  Size: 12          Blocks: 8          IO Block: 4096   regular file
Device: 801h/2049d  Inode: 289123      Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/      cc)   Gid: ( 1000/      cc)
Access: 2017-03-04 21:28:57.807863187 -0800
Modify: 2017-03-04 21:28:57.807863187 -0800
Change: 2017-03-04 21:28:57.863865729 -0800
 Birth: -
  • File: 文件名
  • size: 文件大小
  • Blocks: 文件所占用Block的塊數(shù)
  • IO Block: 文件IO Block的大小
  • regular file: 文件的類型
  • Device: 設備號 以八進制和十進制顯示
  • Inode: inode號
  • Links: 硬鏈接數(shù)量
  • Access : 訪問權(quán)限
  • Uid : 擁有者ID userid
  • Gid : 所在的組的ID
  • Access: 最后訪問時間
  • Modify: 文件內(nèi)容最后修改時間
    -Change: 文件屬性最后修改時間
    注:
    Access,Modify ,Change 三者的區(qū)別
    虛擬文件系統(tǒng)and軟連接硬鏈接

Details of Linux Stat Command Output

  • File: – Absolute path name of the file.
  • Size: – File size in bytes.
  • Blocks: – Total number of blocks used by this file.
  • IO Block: – IO block size for this file.
  • regular file – Indicates the file type. This indicates that this is a - regular file.
    Following are available file types.
    • regular file. ( ex: all normal files ).
    • directory. ( ex: directories ).
    • socket. ( ex: sockets ).
    • symbolic link. ( ex: symbolic links. )
    • block special file ( ex: hard disk ).
    • character special file. ( ex: terminal device file ).
  • Device: – Device number in hex and device number in decimal
  • Inode: – Inode number is a unique number for each file which is used for the internal maintenance by the file system.
  • Links: 1 – Number of links to the file
  • Access: (0600/-rw——-): Access specifier displayed in both octal and character format. Let us see explanation about both the format.
  • Uid: ( 1000/ sathiya) – File owner’s user id and user name are displayed.
  • Gid: ( 1000/ sathiya) – File owner’s group id and group name are displayed.
  • Access: 2009-06-28 19:29:57.000000000 +0530 – Last access time of the file.
  • Modify: 2009-06-28 19:29:57.000000000 +0530 – Last modification time of the file.
  • Change: 2009-06-28 19:29:57.000000000 +0530 – Last change time of the inode data of that file.

stat -f file/dir

stat -f filename
顯示關(guān)于文件系統(tǒng)的信息,而非文件本身

cc@MyLinux:~$ stat -f 123.txt 
  File: "123.txt"
    ID: c6f552ab700bb548 Namelen: 255     Type: ext2/ext3
Block size: 4096       Fundamental block size: 4096
Blocks: Total: 4869551    Free: 3475145    Available: 3222025
Inodes: Total: 1245184    Free: 1033487

參考:
http://blog.csdn.net/clozxy/article/details/7645284

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

  • 公司附近菜市場里有面包鋪子,路過那里的時候,Jens總會兩眼放光。 他一向告訴我,德國的面包非常好吃,特別是這種傳...
    灰土豆閱讀 1,371評論 0 4
  • 生活中,我們常常存在這樣一種傾向,那就是把最好的態(tài)度奉獻給了外人,最壞的一面卻展示給了最親近的人。 也許,在潛意識...
    執(zhí)念向前閱讀 1,458評論 0 3
  • 只在原文更新 一、秘密 小糖球躺在罐子里,絲絲甜香從甜點店里飄到正睡在草地上的薛洋鼻子里 本來睡得正香留著哈喇子的...
    幸村亜夜閱讀 2,467評論 2 27
  • 一度不知道怎么確定自己的標題,愛一個動詞是個太大的題目,以我淺顯的只是只能簡單的說出我目前能力范圍內(nèi)對它的理解。 ...
    暖暖百合花閱讀 485評論 1 1
  • ?生產(chǎn)者和消費者問題是操作系統(tǒng)并發(fā)性經(jīng)典問題之一,描述的是有一塊緩沖區(qū)為倉庫,生產(chǎn)者可以將商品放入倉庫,消費者可以...
    CleanCode閱讀 302評論 0 1

友情鏈接更多精彩內(nèi)容