How to check disk space in Linux: 1. Use the df command to check the file system and obtain information such as how much space is occupied by the hard disk and how much space is currently left. 2. Use the du command to display disk space usage.
#The operating environment of this tutorial: Red Hat Enterprise Linux 6.1 system, Dell G3 computer.
1. Use the df command
df to 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:
Display Content parameter description:
Filesystem: File system
Size: Partition size
Used: Used capacity
#2. Use the du command
du’s original English meaning is disk usage, which means to display the disk Space usage, used to view the total size of the current directory. For example, check the size of the current directory:# du -sh 605M .
# du log2012.log 300 log2012.log
# du -h test 608K test/test6 308K test/test4 4.0K test/scf/lib 4.0K test/scf/service/deploy/product 4.0K test/scf/service/deploy/info 12K test/scf/service/deploy 16K test/scf/service 4.0K test/scf/doc 4.0K test/scf/bin 32K test/scf 8.0K test/test3 1.3M test
Linux Video Tutorial"
The above is the detailed content of How to check disk space in linux. For more information, please follow other related articles on the PHP Chinese website!