Home >System Tutorial >LINUX >Instructions for using df command in Linux
Instructions for using the df command in Linux
The df command is a practical tool in Linux systems for checking disk space usage. Through the df command, we can easily understand the total capacity, used space, and available space of the disk. This article will introduce the use of the df command in detail and provide some specific code examples.
The basic usage of the df command is as follows:
df [选项] [文件系统]
Options:
File system: Specify the file system to be queried, and query all file systems by default
The following are several examples to help readers better understand the use of the df command.
View disk usage (in human-readable form)
df -h
This command will display the disk usage of all file systems in the system, in human-readable form way (that is, displaying capacity in K, M, G, etc. units).
View the disk usage of the specified file system
df /dev/sda1
This command will display the disk usage of the /dev/sda1 file system.
View the disk usage of the specified directory
df /home
This command will display the disk usage of the file system where the /home directory is located.
Display file system type
df -T
This command will display the disk usage of all file systems in the system and include the type of each file system.
Display inode-related information
df -i
This command will display the inode usage of all file systems in the system, including the total number of inodes and the number of used inodes and the number of available inodes.
By using the above example, we can have a clearer understanding of how to use the df command to view disk space usage. In addition to the options in the above example, the df command has some other optional parameters. Readers can obtain more detailed instructions by consulting the help manual of the df command.
Summary: The df command is one of the most commonly used tools in Linux systems, used to check disk space usage. By using the df command rationally, we can understand the disk space usage in a timely manner, which facilitates system management and tuning. I hope this article can help readers understand and use the df command.
The above is the detailed content of Instructions for using df command in Linux. For more information, please follow other related articles on the PHP Chinese website!