How to check the usage of the hard disk

You can use the following command to check the usage of the hard disk on Ubuntu 16.04:

df -h

1
2
3
4
5
6
7
8
9
10
Filesystem      Size  Used Avail Use% Mounted on
udev 483M 0 483M 0% /dev
tmpfs 101M 14M 88M 14% /run
/dev/sda2 52G 9.1G 42G 17% /
tmpfs 504M 0 504M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 504M 0 504M 0% /sys/fs/cgroup
/dev/sda1 361M 162M 181M 48% /boot
tmpfs 101M 0 101M 0% /run/user/1000

This command will show the usage of the hard disk in a human-readable format. The -h option makes the output in sizes that are easier to read, such as “3.5G” or “75M”.

This command will show you the usage of all mounted hard disks on your system.

You can also use the following command to check the free space available in your hard disk:

du -sh /

This command will show you the amount of space used by files and directories in the root directory (i.e., the top-level directory) of your file system.

You can replace the “/“ with the directory you want to check the space usage for.