Checking disk space is very straightforward on Windows. But when it comes to Linux, you might feel a bit lost, hehe. Don’t worry, I’m here to solve this problem for you.
The df command is how Linux checks disk space, viewing the file system by disk partition. You can add parameters to view remaining disk space information. The command format is:
df -hl
The Linux disk space display format is:
文件系统 容量 已用 可用 已用% 挂载点
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 45G 19G 24G 44% /
/dev/hda1 494M 19M 450M 4% /boot
/dev/hda6 4.9G 2.2G 2.5G 47% /home
/dev/hda5 9.7G 2.9G 6.4G 31% /opt
none 1009M 0 1009M 0% /dev/shm
/dev/hda3 9.7G 7.2G 2.1G 78% /usr/local
/dev/hdb2 75G 75G 0 100% /
/dev/hdb2 75G 75G 0 100% /
Taking the output above as an example, it means:
The second hard disk (b) on the HD interface, second partition (2), has a capacity of 75G, 75G used, 0 available, therefore the utilization rate is 100%, and it is mounted on the root partition directory (/).
Below is an explanation of the Linux disk space check commands:
df -hl checks remaining disk space
df -h checks the partition size of each root path
du -sh [directory name] returns the size of that directory
du -sm [folder] returns the total M size of that folder
For more features, you can enter the following commands to check:
df –help
du –help