We can check the disk space from the terminal and graphical user interface based applications.
The commands discussed in this article are generic and can be used on other Linux distribution like Debian, Linux Mint, etc.
Checking the Disk Space from the Terminal
There are many useful commands for checking the disk space from the terminal. In this section, we will discuss the df and du commands.
Using the df command to check the disk space:
The df (Disk Filesystem) command comes pre-installed on Ubuntu 20.04, Ubuntu 20.10, and many other different Linux based operating system. The df command shows the information of various file systems. Moreover, we can use multiple options with it.
Let’s check the disk space using the df command as follows:
The df command shows the total used and available space. Moreover, it also shows the total used space in terms of percentage. In the above-given output, the system’s actual disk is /dev/sda5. The df command shows the disk information in 1k-blocks, and it is very difficult to interpret the output. We can use the -h option with the df command to display the disk space information in a human-readable way, as illustrated in the below image:
The df -h command shows the disk space in gigabytes. In the above-given output, it can be seen that in the in /dev/sda file system, the total size of the disk is 29 gigabytes, whereas the used and available space is 13 and 15 gigabytes, respectively.
Using the du command to check the disk space:
The du command stands for Disk Usage. It shows the disk information of every directory and subdirectory. Let’s execute the following du command:
The size of directories of subdirectories is displayed in 1k-block.
The –h options can also be used with the du command to display the disk information in a human-readable way, as shown below:
The du -h command shows the disk usage in kilobytes and megabytes.
Checking the Disk Space from the Graphical Applications
Checking the disk space using the graphical user interface based applications is very easy in Ubuntu 20.04 and 20.10. There are two graphical applications for checking disk space, i.e., Disk Usage Analyzer and Disks.
Using the disk usage analyzer application:
Open the ‘Application Menu’ and search for the disk usage analyzer application.
Click on the ‘Disk Usage Analyzer’ application icon to open it. You will see the actual disk with ‘Available’ and ‘Total space’. Click on the disk to see more details.
Using the disk utility:
The Disk GNOME utility comes pre-installed in Ubuntu 20.04 and 20.10. Search for ‘Disks’ in the ‘Application Menu’ and open it.
The ‘Disks’ utility shows the total size of the disk and the free disk space.
Checking the disk space is a very important activity for smooth system usage. In Ubuntu 20.04, 20.10, and many Linux distributions, we can check the disk space from the command-line and graphically. This article explains the commands and graphical applications for checking the system disk usage.