This article explains using the df
command in Ubuntu Linux. It also provides examples you can use in your environment.
The df
command in Ubuntu Linux is a command-line tool that displays disk usage information. It gives users an overview of the available and used disk space on mounted filesystems.
You can customize the output using different options with the df
command to suit your needs. Whether you want to check the overall disk usage or examine specific filesystems, the df
command helps you understand your system’s storage utilization.
Syntax
The basic syntax of the df
command is as follows:
df [OPTIONS] [FILESYSTEM]
Common options
Here are some of the commonly used options with the df
command:
-h, --human-readable
– Displays sizes in a more human-readable format, using units likeK
,M
,G
, etc.-T, --print-type
– Shows the filesystem type.-i, --inodes
– Displays the inode information instead of block usage.-a, --all
– Includes all filesystems, including those that are not mounted.-x, --exclude-type=TYPE
– Excludes filesystems of a specific type from the output.-l, --local
– Shows local filesystems only.
Usage examples
- Display disk space usage of all mounted filesystems in human-readable format:
df -h
- Show disk usage of a specific filesystem:
df /dev/sda1
- Exclude specific types of filesystems (e.g., tmpfs) from the output:
df -x tmpfs
- View disk usage inodes instead of block usage:
df -i
- Display all filesystems, including those that are not mounted:
df -a
- Show only local filesystems:
df -l
That should do it!
Remember to consult the man
page for df
(man df
) to explore more advanced options and functionalities.
Conclusion:
After reading this article, you should now be able to:
- Understand the purpose of the
df
command in Ubuntu Linux - Customize the output using different options with the
df
command - Check both the overall disk usage and specific file systems
- Refer to the
man
page fordf
(man df
) to explore more advanced options and functionalities.
Leave a Reply Cancel reply