This tutorial will guide you to check the hard drive space using the command df in Linux.
The command df is used to get information about the entire drive on the Linux system, how much space is used and how much space can be used.
Here are some common df commands (tested with Ubuntu):
Displays the hard drive space of system files used
1 2 3 4 5 6 7 8 9 10 |
khanh@ubuntu:~$ df Filesystem 1K-blocks Used Available Use% Mounted on udev 2008376 0 2008376 0% /dev tmpfs 403900 11272 392628 3% /run /dev/sda1 102049120 9613228 87229060 10% / tmpfs 2019496 156 2019340 1% /dev/shm tmpfs 5120 4 5116 1% /run/lock tmpfs 2019496 0 2019496 0% /sys/fs/cgroup cgmfs 100 0 100 0% /run/cgmanager/fs tmpfs 403900 56 403844 1% /run/user/1000 |
Displays the hard drive space of system files used in MB, GB, and TB
1 2 3 4 5 6 7 8 9 10 |
khanh@ubuntu:~$ df -h Filesystem Size Used Avail Use% Mounted on udev 2.0G 0 2.0G 0% /dev tmpfs 395M 12M 384M 3% /run /dev/sda1 98G 9.2G 84G 10% / tmpfs 2.0G 156K 2.0G 1% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup cgmfs 100K 0 100K 0% /run/cgmanager/fs tmpfs 395M 52K 395M 1% /run/user/1000 |