Linux Command learning Note: DF command

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's file system. You can use this command to get information about how much space the hard disk is taking up, and how much space is left. 1. Command format:DF[Options] [file]2. Command function: Displays the available space for the specified disk file. If no file name is specified, all available space for the currently mounted file system will be displayed. By default, disk space is displayed in 1KB, unless the environment variable posixly_correct is specified, which is displayed in 512-byte units3. Command parameters: Required Parameters:-a list of all file systems-h Easy to read mode display-H equals "-H", but the formula, 1k= +, not 1k=1024x768-I display inode information-k block is 1024 bytes-l Show only local file system-m block is 1048576 bytes--no-SyncIgnoreSyncCommand-P output format is POSIX--Syncperform the sync command before obtaining the disk information-T File System type selection parameters:--block-size=< Block Size >Specify chunk size-t< File System Type >displays only disk information for the selected file system-x< File System Type >does not display disk information for the selected file system--Help Display assistance information--version displays release information4. Usage Example: Instance 1: Show disk usage command:DFoutput: [[email protected] log]#DFFile 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. Use in list%The column 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. Example 2: Display the disk usage command in inode mode:DF-i output: [[email protected] log]#DF-I file system Inode (i) Used (i) available (i) Used%mount point/dev/sda75124480    5560 5118920    1%//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/SHM Description: Instance 3: Displays the specified type of disk command:DF-t ext3 output: [[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 Description: Instance 4: Lists the I node usage commands for each file system:DF-ia output: [[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 Description: Example 5: List the file system type commands:DF-t output: [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 Description: Example 6: Display current disk space and usage commands in a more readable manner: output: [[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-H Root above-The h parameter is the same, but at the time of the radical conversion, the capacity is converted by 1000 instead of 1024 .-k Displays disk usage in units-L Displays the disk space utilization of the local partition, and if the server NFS drives the remote server's disk, add the-L After the system shows the results after filtering NSF drive-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 learning Note: DF command

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.