Linux command: DF

Source: Internet
Author: User
Tags readable disk usage

The function of the DF command in Linux is to check the disk space usage of the Linux server file system, which can be used to get the amount of space the hard disk occupies and how much space is left.

DF View storage Device mount information

Command parameters:

Necessary parameters:

-A All File system list

-h easy to read mode display

-H equals "-H", but the formula, 1k=1000, rather than 1k=1024

-I display inode information

-K block is 1024 bytes

-L show local file system only

-M block is 1048576 bytes

--no-sync Ignore sync command

-P output format POSIX

--sync perform the sync command before obtaining the disk information

-T File system type

Usage examples:

Command 1:DF, view disk information

[[email protected] log]# DF file System 1K-Block used available%mount point/dev/sda719840892    890896  17925856   5%//DEV/SDA9203727156 112797500  80413912   -% /opt/dev/sda84956284    570080   4130372   -% /var/dev/sda619840892   1977568  16839184   One% /usr/dev/sda3988116     23880    913232   3% /Boottmpfs16473212         0  16473212   0%/DEV/SHM

Description

The 1th column of the output list of the DF command in Linux is the pathname of the device file that represents the file system (typically the partition on the hard disk), and the 2nd column gives the number of blocks (1024 bytes) that the partition contains, and the 3rd, 4 columns indicate the number of data blocks used and available respectively. Users may be surprised that 3rd, the sum of 4 column blocks is not equal to the number of blocks in the 2nd column. This is because each of the default partitions leaves a small amount of space for the system administrator to use. The administrator can log in and leave the workspace required to resolve the problem, even when the normal user space is full. The use% column in the list represents the percentage of normal user space used, even if the number reaches 100%, and the partition still leaves room for the system administrator to use. Finally, the mounted on column represents the mount point of the file system.

Explain the file system here.

/dev/Representative Equipment

/SDA1 here the four-digit number is interpreted separately

SD stands for hard disk type, Sd:scsi,sata hard drive, hd:ide HDD

A represents the hard drive serial number, a: The first hard disk, B: The second hard disk, and so on.

1 for partition ordinal, first partition

Command 2:df-i, displaying disk usage in Inode mode

[Email protected] log]# df-i

File System Inode (i) Used (i) available (i)% mount point used

/dev/sda7 5124480 5560 5118920 1%/

/DEV/SDA9 52592640 50519 52542121 1%/opt

/dev/sda8 1280000 8799 1271201 1%/var

/dev/sda6 5124480 80163 5044317 2%/usr

/dev/sda3 255232 255198 1%/boot

TMPFS 4118303 1 4118302 1%/DEV/SHM

Description: Inode

The inode contains meta information for the file, specifically the following:
* Number of bytes in the file
* User ID of the owner of the file
* The group ID of the file
* file read, write, execute permissions
* File timestamp, total three: CTime refers to the time when the inode was last changed, mtime refers to the time when the file content was last changed, atime refers to the time when the file was last opened.
* Number of links, that is, how many filenames point to this inode
* Location of File data block

Command 3:df-t ext3, displaying the specified type of disk

[Email protected] log]# DF-t ext3 file system 1K-Block used available%mount point/dev/sda719840892    890896  17925856   5%//DEV/SDA9203727156  93089700 100121712   the% /opt/dev/sda84956284    570104   4130348   -% /var/dev/sda619840892   1977568  16839184   One% /usr/dev/sda3988116     23880    913232   3%/boot

Command 4:df-ia, which lists the I node usage for each file system

[Email protected] log]# DF-ia File System Inode ( i) used (i) available (i) used%mount point/dev/sda75124480    5560 5118920    1%/proc0       0       0-  /Procsysfs0       0       0-  /sysdevpts0       0       0-/dev/pts/dev/sda952592640   50519 52542121    1% /opt/dev/sda81280000    8799 1271201    1% /var/dev/sda65124480   80163 5044317    2% /usr/dev/sda3255232       the  255198    1% /Boottmpfs4118303       1 4118302    1%/dev/Shmnone0       0       0-/proc/sys/fs/binfmt_misc

Command 5 df-t, listing the type of file system

[Email protected] log]# DF-T File system type 1K-Block used available%mount point/DEV/SDA7 ext319840892    890896  17925856   5%//dev/sda9 ext3203727156  93175692 100035720   the% /opt/dev/sda8 ext34956284    570104   4130348   -% /var/dev/sda6 ext319840892   1977568  16839184   One% /usr/dev/sda3 ext3988116     23880    913232   3% /Boottmpfs Tmpfs16473212         0  16473212   0%/DEV/SHM

Command 6:df-h to display current disk space and usage in a more readable manner

[Email protected] log]# DF-h file system capacity already available for use%mount point/DEV/SDA7 19G 871M 18G5%//dev/sda9 195G 89G 96G the% /opt/dev/sda84.8G 557M4.0G -% /var/dev/sda6 19G1.9G 17G One% /usr/dev/sda3 965M 24M 892M3% /Boottmpfs 16G016G0%/dev/Shm[[email protected] log]# DF-h file system capacity already available for use%mount point/DEV/SDA7 21G 913M 19G5%//dev/sda9 209G 96G 103G the% /opt/dev/sda85.1G 584M4.3G -% /var/dev/sda6 21G2.1G 18G One% /usr/dev/sda31.1G 25M 936M3% /Boottmpfs 17G017G0%/dev/Shm[[email protected] log]# DF-LH File system capacity already available for use%mount point/DEV/SDA7 19G 871M 18G5%//dev/sda9 195G 89G 96G the% /opt/dev/sda84.8G 557M4.0G -% /var/dev/sda6 19G1.9G 17G One% /usr/dev/sda3 965M 24M 892M3% /Boottmpfs 16G016G0%/dev/Shm[[email protected] log]# DF-k file System 1K-Block used available%mount point/dev/sda719840892    890896  17925856   5%//DEV/SDA9203727156  93292572  99918840   the% /opt/dev/sda84956284    570188   4130264   -% /var/dev/sda619840892   1977568  16839184   One% /usr/dev/sda3988116     23880    913232   3% /Boottmpfs16473212         0  16473212   0%/DEV/SHM

Description

-H more Current disk space and usage to display in a more readable manner

The-h parameter is the same on the-H root, but at the time of the radical conversion, the capacity is converted by 1000 instead of 1024.

-K displays disk usage in units

-L shows the disk space usage of the local partition, if the server NFS the disk of the remote server, then the system displays the result after the filter NSF drive after adding-l to DF

-I displays the usage of the inode. Linux uses a pointer-like approach to managing disk space mapping. This is also a more critical application

Linux command: DF

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.