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