> **Question**: I know I can use df command to check a file system's disk space usage on Linux. Can you show me practical examples of the df command so that I can make the most out of it?
As far as disk storage is concerned, there are many command-line or GUI-based tools that can tell you about current disk space usage. These tools report on detailed disk utilization in various human-readable formats, such as easy-to-understand summary, detailed statistics, or [intuitive visualization][1]. If you simply want to know how much free disk space is available for different file systems, then df command is probably all you need.
The df command can report on disk utilization of any "mounted" file system. There are different ways this command can be invoked. Here are some **useful** df **command examples**.
### Display in Human-Readable Format ###
By default, the df command reports disk space in 1K blocks, which is not easily interpretable. The "-h" parameter will make df print disk space in a more human-readable format (e.g., 100K, 200M, 3G).
$ df -h
----------
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ubuntu-root 909G 565G 299G 66% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 3.9G 4.0K 3.9G 1% /dev
tmpfs 785M 1.2M 784M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 63M 3.8G 2% /run/shm
none 100M 48K 100M 1% /run/user
/dev/sda1 228M 98M 118M 46% /boot
### Display Inode Usage ###
When you monitor disk usage, you must watch out for not only disk space, but also "inode" usage. In Linux, inode is a data structure used to store metadata of a particular file, and when a file system is created, a pre-defined number of inodes are allocated. This means that a file system can run out of space not only because big files use up all available space, but also because many small files use up all available inodes. To display inode usage, use "-i" option.
By default, the df command shows disk utilization of individual file systems. If you want to know the total disk usage over all existing file systems, add "--total" option.
$ df -h --total
----------
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ubuntu-root 909G 565G 299G 66% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 3.9G 4.0K 3.9G 1% /dev
tmpfs 785M 1.2M 784M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 62M 3.8G 2% /run/shm
none 100M 48K 100M 1% /run/user
/dev/sda1 228M 98M 118M 46% /boot
total 918G 565G 307G 65% -
### Display File System Types ###
By default, the df command does not show file system type information. Use "-T" option to add file system types to the output.
$ df -T
----------
Filesystem Type 1K-blocks Used Available Use% Mounted on
### Include or Exclude a Specific File System Type ###
If you want to know free space of a specific file system type, use "-t <type>" option. You can use this option multiple times to include more than one file system types.
$ df -t ext2 -t ext4
----------
Filesystem 1K-blocks Used Available Use% Mounted on
To exclude a specific file system type, use "-x <type>" option. You can use this option multiple times as well.
$ df -x tmpfs
### Display Disk Usage of a Specific Mount Point ###
If you specify a mount point with df, it will report disk usage of the file system mounted at that location. If you specify a regular file (or a directory) instead of a mount point, df will display disk utilization of the file system which contains the file (or the directory).
$ df /
----------
Filesystem 1K-blocks Used Available Use% Mounted on
### Display Information about Dummy File Systems ###
If you want to display disk space information for all existing file systems including dummy file systems, use "-a" option. Here, dummy file systems refer to pseudo file systems which do not have corresponding physical devices, e.g., tmpfs, cgroup virtual file system or FUSE file systems. These dummy filesystems have size of 0, and are not reported by df without "-a" option.
$ df -a
----------
Filesystem 1K-blocks Used Available Use% Mounted on