2019-04-21 11:50:48 +08:00

39 lines
1.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="stat">stat</h1>
<p>用于显示文件的状态信息</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>stat命令</strong> 用于显示文件的状态信息。stat命令的输出信息比ls命令的输出信息要更详细。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">stat(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-L支持符号连接
-f显示文件系统状态而非文件状态
-t以简洁方式输出信息
--help显示指令的帮助信息
--version显示指令的版本信息。</code></pre>
<h3 id="参数">参数</h3>
<p>文件:指定要显示信息的普通文件或者文件系统对应的设备文件名。</p>
<h3 id="实例">实例</h3>
<pre><code class="language-bash">[root@localhost ~]# ls -l myfile
-rw-r--r-- 1 root root 0 2010-10-09 myfile
[root@localhost ~]# 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
[root@localhost ~]# stat -f myfile
File: &quot;myfile&quot;
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
[root@localhost ~]# stat -t myfile
myfile 0 8 81a4 0 0 fd00 194805815 1 0 0 1292127755 1286628261 1286628261 4096
</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->