2010年5月29日星期六

Linux stat 命令

1、查看文件系统信息
$ stat -f /
File: "/"
ID: 8e77392dbf169cb Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 3696170 Free: 2714077 Available: 2526318
Inodes: Total: 940240 Free: 786618

-f后一定要有参数,可以是普通文件或目录,输出结果都一样。

$ stat -f minicom.log
File: "minicom.log"
ID: 8e77392dbf169cb Namelen: 255 Type: ext2/ext3
Block size: 4096 Fundamental block size: 4096
Blocks: Total: 3696170 Free: 2714074 Available: 2526315
Inodes: Total: 940240 Free: 786615

2、查看单个文件状态
$ stat minicom.log
File: `minicom.log'
Size: 35 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 3266 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2010-05-27 08:41:43.392901001 +0800
Modify: 2010-05-17 19:57:04.707404145 +0800
Change: 2010-05-17 19:57:04.707404145 +0800


3、查看单个文件的单项信息。


查看文件大小
$ stat --format=%s minicom.log
35

查看文件类型
$ stat --format=%F minicom.log
regular file

标签:


评论: 发表评论

订阅 博文评论 [Atom]





<< 主页

This page is powered by Blogger. Isn't yours?

订阅 博文 [Atom]