Go Linux System stat Instruction usage

Source: Internet
Author: User

Original: https://www.cnblogs.com/linux-super-meng/p/3812695.html

STAT directive: Details of File/file system display (view file properties).

The stat command is primarily used to display detailed information about a file or file system, which has the following syntax:

-F does not display information about the file itself and displays information about the file system where the file resides

-L Display Symbolic links

-T compact mode, displaying only summary information

In fact, the stat command displays the I node information for the file. The Linux file system stores information in blocks, and each file is indexed with the I node in order to find the location of the storage space where the file resides.

  

The so-called I node, which is a data structure for file system management, is a 64-byte long table that contains all the information necessary to describe the file, including the size, type, access permissions, and the owner = = of the file

Querying information for RC.D files

[[Email protected] rc.d]# stat rc0.d///can clearly analyze the information of a file or directory
File: ' rc0.d/'
size:4096 blocks:8 IO block:4096 Directory
device:fd00h/64768d inode:1309217 Links:2
Access: (0755/drwxr-xr-x) Uid: (0/root) Gid: (0/root)
Access:2014-06-26 21:02:26.776082938 +0800
modify:2014-06-12 15:16:57.848087079 +0800
change:2014-06-12 15:16:57.848087079 +0800

[[email protected] rc0.d]# du-sh//All files in this directory are 4K and the same size as above
4.0K.

To inquire about the file system where the Ec.d file is located:

[[email protected] rc.d]# stat-f rc0.d///This display is the same as the current system file system information, because rc.0 is in the current system's file system
File: "Rc0.d/"
id:303116b72802c784 namelen:255 TYPE:EXT2/EXT3
Block size:4096 fundamental block size:4096
blocks:total:7558388 free:5545748 available:5161800
inodes:total:1921360 free:1850717

You can also view your hard disk's information

[Email protected] rc.d]# STAT/DEV/SDA
File: '/dev/sda '
size:0 blocks:0 IO block:4096 Block Special File
device:5h/5d inode:6308 links:1 Device type:8,0
Access: (0660/BRW-RW----) Uid: (0/root) Gid: (6/disk)
Access:2014-06-27 20:57:07.213940088 +0800
Modify:2014-06-27 20:57:05.037938949 +0800
Change:2014-06-27 20:57:05.037938949 +0800

SDA hard disk File system Information

[Email protected] rc.d]# stat-f/DEV/SDA
File: "/DEV/SDA"
id:0 namelen:255 Type:tmpfs
Block size:4096 fundamental block size:4096
blocks:total:61793 free:61734 available:61734
inodes:total:61793 free:61080

Go Linux System stat Instruction usage

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.