www.lautturi.com
How to use df command in Linux / Unix {with examples}The df
command stands for "disk free," and it is used to show the amount of free space available on a Linux or Unix-based system. It displays the amount of available space on all mounted file systems, including the file system type, the mount point, and the size of the file system.
Here are some examples of how to use the df
command:
- To display information about all mounted file systems, including the file system type, the mount point, the total size of the file system, the amount of space that is used, and the percentage of space that is used, use the following command:
df -h
- To display information about a specific file system, specify the mount point or file system name as an argument:
df -h /dev/sda1
- To display information about all file systems, including those that are not mounted, use the
-a
option:
df -a
- To display information in kilobytes, use the
-k
option:
df -k
- To display information in blocks (the default block size is 1024 bytes), use the
-B
option followed by the block size:
df -B 512
- To display information about the inodes (index nodes) used by a file system, use the
-i
option:
df -i
- To exclude file systems of a certain type, use the
-x
option followed by the file system type:
df -x tmpfs