The command to check the disk space in Linux system is [df -hl]. This command can check the remaining space of the disk. If you want to check the partition size of each root path, you can use the [df -h] command. The df command views the file system in units of disk partitions.
The operating environment of this article: red hat enterprise linux 6.1 system, thinkpad t480 computer.
(Learning video sharing: linux video tutorial)
Linux can use the df and du commands to check the disk space.
df command
df View the file system in units of disk partitions. You can obtain information such as how much space is occupied by the hard disk and how much space is currently left.
For example, we use the df -h command to view disk information. The -h option is to display appropriately according to the size:
Related commands:
df -hl: Check the remaining disk space
df -h: Check the partition size of each root path
du command
du The original English meaning of du is disk usage , meaning to display disk space usage and used to view the total size of the current directory.
For example, check the size of the current directory:
# du -sh 605M .
Display the space occupied by the specified file:
# du log2012.log 300 log2012.log
Display the space occupied by the test directory in an easy-to-read format:
Related recommendations: linux tutorial
The above is the detailed content of What is the command to check disk space in Linux system. For more information, please follow other related articles on the PHP Chinese website!