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.
Grammar:
DF [-ahikhtm] [directory or file name]
Options and Parameters:
- -a: Lists all file systems, including system-specific/proc File system
- -k: Kbytes The capacity of the file system;
- -m: MBytes capacity displays each file system;
- -H: GBytes, MBytes, Kbytes and other formats that are easier for people to read;
- -h: Take m=1000k instead of m=1024k;
- -T: Displays the file system type, along with the filesystem name of the partition (for example, ext3);
- -i: No hard disk capacity, and the number of inode to display
Example 1
List all the file systems in the system!
[Email protected] ~]$ dffilesystem 1k-blocks used Available use% mounted on/dev/sda2 18339256 3550212 13857460 21%/tmpfs 502304 + 502220 1%/dev/shm/dev/sda1 297485 33548 248577 12%/boot
Under Linux If DF does not have any options, the default is to list all of the system's (non-special in-memory file systems and Swaps) in 1 Kbytes capacity!
Example 2
Display capacity results in an easy-to-read capacity format
[Email protected] ~]$ df-hfilesystem Size used Avail use% mounted on/dev/sda2 18G 3.4G 14G 21%/tmpfs 491M 84K 491M 1%/dev/shm/dev/sda1 291M 33M 243M 12%/boot
Example 3
List all special file formats and names in the system
[Email protected] ~]$ df-athfilesystem Type Size used Avail use% mounted on/dev/sda2 ext4 18G 3.4G 14G 21%/proc proc 0 0 0 - /procsysfs sysfs 0 0 0 - /sysdevpts devpts 0 0 0 - /dev/ptstmpfs tmpfs 491M 84K 491M 1%/dev/shm/dev/sda1 ext4 291M 33M 243M 12%/bootnone Binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_miscvmware-vmblockfuse.vmware-vmblock 0 0 0 - /var/run/vmblock-fuse
Example 4
Displays the available disk capacity under/etc in an easy-to-read capacity format
[Email protected] ~]$ df-h/etcfilesystem Size used Avail use% mounted on/dev/sda2 18G 3.4G 14g< c6/>21%/
DF of the Linux command