Debian

How do I Check Disk Space in Debian-LinuxHint

It is important to stay updated with disk usage for various reasons, discussed in the next section. We will be using the df command in this article for getting information about the disk, and we will also discuss how one can check the space available and consumed on one disk.

Why Check Disk Space?

It is essential to monitor disk usage frequently since insufficient disk space might cause numerous services on your system to break. Furthermore, there are regular updates in Linux distributions that need adequate space for installation. As a result, you must ensure that sufficient disk space is accessible.

One can check Disk Space using the df command.

This command gives information about the total space consumed and available on your disk.

The syntax for the command is:

$ df [options] [files]

If no option is given, this command outputs the space used and available on all the file systems.

Below is the table showing the meaning of each column in the above command

Column Name Valid Field Name Meaning
Filesystem source This column displays the mount point source. This is usually an external device.
1K-blocks size Display the total quantity of blocks present in the disk.
Used used Displays the number of blocks used.
Available avail Displays the number of available blocks.
Use% pcent Displays percentage of used space
Mounted on target Specifies the mount point.

To get disk information of a particular file, use the following command.

$ df /home/maaz/test/test.txt

Output

Filesystem     1K-blocks   Used     Available  Use%    Mounted on
/dev/sda2      69872174   57721420  12150754   82.6%      /home

To get total space usage and availability on our disk, use the –total option with the command.

To check disk space in powers of 1024, use the -h option with the command.

Conclusion

This article went through a detailed discussion regarding checking disk usage in your Debian Operating System. We discussed the df command to extract information about the disk. This command provides detailed information on the file systems through various options.

About the author

Simran Kaur

Simran works as a technical writer. The graduate in MS Computer Science from the well known CS hub, aka Silicon Valley, is also an editor of the website. She enjoys writing about any tech topic, including programming, algorithms, cloud, data science, and AI. Travelling, sketching, and gardening are the hobbies that interest her.