Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the function of the stat command in Linux

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what the role of the stat command in Linux is, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

1. The function of stat command:

The stat command displays detailed attribute information about a file or directory, including the file system status, which is more detailed than the output of the ls command.

2. Common options:

Option

The function-f displays the file system status, not the file status. -t print the information in a concise form

3. Examples:

1) No options are added by default

[root@localhost ~] # lsanaconda-ks.cfg ip.txt number www [root@localhost ~] # stat www File: 'www' Size: 34 Blocks: 8 IO Block: 4096 regular fileDevice: fd00h/64768d Inode: 33618826 Links: 1Access: (0644 Mae RWMurray RWMI -) Uid: (0 / root) Gid: (0 / root) Context: unconfined_u:object _ r:admin_home_t:s0Access: 2020-01-02 1440 Birth 50.771405666 + 0800Modify: 2019-12-17 2340 Birth:-

Note:

Access: the time when the file was accessed

Modify: the time when the file was modified

Change: when the I node (attribute information) of the file was last modified. Note: the information of node I will also be modified when the file is modified.

2)-f option, which only looks at the file system status.

[root@localhost] # stat-f www File: "www" ID: fd0000000000 Namelen: 255Type: xfsBlock size: 4096 Fundamental block size: 4096Blocks: Total: 4452864 Free: 4140969 Available: 4140969Inodes: Total: 8910848 Free: 8877166

Note:

Type: file system typ

3)-t option, which displays information in a concise way

[root@localhost] # stat-t www www 34 8 81ed 00 fd00 33618826 1 00 1577947250 1576597777 1577954750 04096 unconfined_u:object_r:admin_home_t:s0 about the role of the stat command in Linux is shared here. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report