df Command: Tutorial & Examples
Display information about free disk space
df command is a Linux utility that displays the amount of available disk space for file systems on which the system is installed. When you run the
df command without any
options, it displays the amount of available disk space on all mounted file systems.
Here is an example of how to use the df command:
This will produce output similar to the following:
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 195351248 94655608 93970828 52% / devtmpfs 491520 0 491520 0% /dev tmpfs 499128 872 498256 1% /run tmpfs 499128 0 499128 0% /dev/shm tmpfs 499128 100 499028 1% /run/lock tmpfs 499128 0 499128 0% /sys/fs/cgroup
The output shows information about each mounted file system, including the file system type, the total size of the file system, the amount of space that is used, the amount of space that is available, and the mount point (i.e., the directory where the file system is mounted).
df command also has a number of options that you can use to customize its behavior. For example, you can use the
-h option to display the sizes of the file systems in
human-readable format (e.g., in MB or GB instead of in blocks). You can also use the
-t option to display information only for file systems of a specific type (e.g.,
-t ext4 to
display information only for ext4 file systems).