in

LinuxLinux

DF Command in Linux: DF Command to Check Disk Space in Linux

12+ DF Commands to check Disk Space in Linux

DF Command in Linux

D

F Command in Linux: DF commands stands for Disk Free in Linux. This DF commands stands for Disk Free in Linux. DF command will provide the complete information about Disk space usage of a system in Linux. In this tutorial, we mentioned differnet usages of DF command in Linux with examples.

Jump To:

Check File System Disk space usage using DF command:

With the help of DF command, you can display the total disk space and currently used disk space in Terminal. Use the following command,

$df

The output of the above command is,

Output
Filesystem     1K-blocks     Used Available Use% Mounted on
udev             1929836        0   1929836   0% /dev
tmpfs             391052     1868    389184   1% /run
/dev/sda2      210060932 28746388 170574320  15% /
tmpfs            1955240   190980   1764260  10% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs            1955240        0   1955240   0% /sys/fs/cgroup
/dev/loop2         90624    90624         0 100% /snap/core/7169
/dev/loop0        144128   144128         0 100% /snap/gnome-3-26-1604/88

Display Information of all File System using DF command:

You can display the Dummy file system which consuming the disk space using the following command,

$df -a
The output of the following command is,

Output
[email protected]:~$ df -a
Filesystem     1K-blocks     Used Available Use% Mounted on
sysfs                  0        0         0    - /sys
proc                   0        0         0    - /proc
udev             1929836        0   1929836   0% /dev
devpts                 0        0         0    - /dev/pts
tmpfs             391052     1868    389184   1% /run
/dev/sda2      210060932 28744680 170576028  15% /
securityfs             0        0         0    - /sys/kernel/security
tmpfs            1955240   313864   1641376  17% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs            1955240        0   1955240   0% /sys/fs/cgroup

Display Disk Space Usage in Human Readable Format:

The output of the DF command is in the bytes and not able to read by Humans. With the help of the below command, you can read the Disk space values. Use the below command,

$df -h

The output of the above command is,

Output
[email protected]:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           382M  1.9M  381M   1% /run
/dev/sda2       201G   28G  163G  15% /
tmpfs           1.9G  154M  1.8G   9% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup

The above command displays the Disk Space values in the human-readable format (GB, MB & Bytes).

Check this too  Traceroute Command For Linux: Syntax & Examples

Display /home file system information:

To display the /home file system information using the DF command,

$df -hT /home

The output of the above command is,

Output
[email protected]:~$ df -hT /home
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sda2      ext4  201G   28G  163G  15% /

Display File System information in Bytes:

DF command allows you display the file system values in bytes. Use the following command,

$df -k
The output of the above command is,

Output
[email protected]:~$ df -k
Filesystem     1K-blocks     Used Available Use% Mounted on
udev             1929836        0   1929836   0% /dev
tmpfs             391052     1868    389184   1% /run
/dev/sda2      210060932 28747832 170572876  15% /
tmpfs            1955240   158008   1797232   9% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs            1955240        0   1955240   0% /sys/fs/cgroup

Display File System information in MB:

DF command will display the file system information in MB values. Use the following command,

$df -m
The output of the above command is,

Output
[email protected]:~$ df -m
Filesystem     1M-blocks  Used Available Use% Mounted on
udev                1885     0      1885   0% /dev
tmpfs                382     2       381   1% /run
/dev/sda2         205138 28076    166574  15% /
tmpfs               1910   157      1753   9% /dev/shm
tmpfs                  5     1         5   1% /run/lock
tmpfs               1910     0      1910   0% /sys/fs/cgroup

Display File System information in GB:

DF command will display the File System information in GB value. Use the following command,

$df -h

The output of the above command is,

Output
[email protected]:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.9G     0  1.9G   0% /dev
tmpfs           382M  1.9M  381M   1% /run
/dev/sda2       201G   28G  163G  15% /
tmpfs           1.9G  100M  1.8G   6% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup

Display the number of inodes using DF command:

You can use the DF command to display the number of inodes and its percentage. Use the following command,

$df -i

The output of the above command is,

Output
[email protected]:~$ df -i
Filesystem       Inodes  IUsed    IFree IUse% Mounted on
udev             482459    641   481818    1% /dev
tmpfs            488810   1218   487592    1% /run
/dev/sda2      13410304 293035 13117269    3% /
tmpfs            488810    269   488541    1% /dev/shm
tmpfs            488810      6   488804    1% /run/lock
tmpfs            488810     18   488792    1% /sys/fs/cgroup

Show File system type using DF command:

You can use the DF command to display the File system type. Use the following command,

Check this too  Bash Case Statement Command Syntax & Examples in Linux {Latest}
$df -T

The output of the above command is,

Output
[email protected]:~$ df -T
Filesystem     Type     1K-blocks     Used Available Use% Mounted on
udev           devtmpfs   1929836        0   1929836   0% /dev
tmpfs          tmpfs       391052     1868    389184   1% /run
/dev/sda2      ext4     210060932 28744864 170575844  15% /
tmpfs          tmpfs      1955240   103988   1851252   6% /dev/shm
tmpfs          tmpfs         5120        4      5116   1% /run/lock
tmpfs          tmpfs      1955240        0   1955240   0% /sys/fs/cgroup

From the above output, Using DF command allows you to display the File System type in the Terminal.

Display Certain File system type:

With the help of DF command, you can display the certain file system type disk space in the Terminal. Use the following command,

$df -t ext4
The output of the following command is,
Output
[email protected]:~$ df -t ext4
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda2      210060932 28753024 170567684  15% /

Display Excluded File system type:

If you want to display the file system type, not belonged to the certain file system type and then use the following command:

$df -x vfat

The above command will display the file system values not belongs to the “vfat” file system type. The output of the above command is,

Output
[email protected]:~$ df -x vfat
Filesystem     1K-blocks     Used Available Use% Mounted on
udev             1929836        0   1929836   0% /dev
tmpfs             391052     1868    389184   1% /run
/dev/sda2      210060932 28744272 170576436  15% /
tmpfs            1955240   102444   1852796   6% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs            1955240        0   1955240   0% /sys/fs/cgroup

DF Command complete information:

You can find the complete information about DF command using the following command,

$df --help

The output of the above command is,

Output
[email protected]:~$ df --help
Usage: df [OPTION]... [FILE]...
Show information about the file system on which each FILE resides,
or all file systems by default.

Mandatory arguments to long options are mandatory for short options too.
  -a, --all             include pseudo, duplicate, inaccessible file systems
  -B, --block-size=SIZE  scale sizes by SIZE before printing them; e.g.,
                           '-BM' prints sizes in units of 1,048,576 bytes;
                           see SIZE format below
  -h, --human-readable  print sizes in powers of 1024 (e.g., 1023M)
  -H, --si              print sizes in powers of 1000 (e.g., 1.1G)
  -i, --inodes          list inode information instead of block usage
  -k                    like --block-size=1K
  -l, --local           limit listing to local file systems
      --no-sync         do not invoke sync before getting usage info (default)
      --output[=FIELD_LIST]  use the output format defined by FIELD_LIST,
                               or print all fields if FIELD_LIST is omitted.
  -P, --portability     use the POSIX output format
      --sync            invoke sync before getting usage info
      --total           elide all entries insignificant to available space,
                          and produce a grand total
  -t, --type=TYPE       limit listing to file systems of type TYPE
  -T, --print-type      print file system type
  -x, --exclude-type=TYPE   limit listing to file systems not of type TYPE
  -v                    (ignored)
      --help     display this help and exit
      --version  output version information and exit

Display values are in units of the first available SIZE from --block-size,
and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.
Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).

The SIZE argument is an integer and optional unit (example: 10K is 10*1024).
Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).

FIELD_LIST is a comma-separated list of columns to be included.  Valid
field names are: 'source', 'fstype', 'itotal', 'iused', 'iavail', 'ipcent',
'size', 'used', 'avail', 'pcent', 'file' and 'target' (see info page).

GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation at: <https://www.gnu.org/software/coreutils/df>
or available locally via: info '(coreutils) df invocation'

The –help command, helps you provide the complete information about using the DF command in Linux.

Check this too  Paste Command in Linux: Syntax, Commands & Examples!

Verdict:

That’s it, Here we provided the DF Commands usages with examples in Linux. If you have any queries related to this topic and then feel free to comment us below.

Article Review
  • Article Explanation
  • Commands Provided
  • Images Provided
4.9

Summary

For more articles, Kindly visit our HomePage

Leave a Reply

Your email address will not be published. Required fields are marked *

Written by Julian

Hello Folks! I'm Julian, Promoted to the Content writer for the category of Commands & Web Apps in Tec Robust. Enjoy my content & Learn more Linux Commands!

Contact me:
tecrobust [@] gmail.com
Sub: Message to Julian

Ubuntu 18.04.3 Released

Ubuntu 18.04.3 Released & Download- Canonical announced the release of 18.04.3 LTS Edition

slack Ubuntu

Slack Ubuntu- How To Install Slack on Ubuntu 18.04 LTS & 19.04