check disk space in Linux

How to check disk space in Linux?

Keeping track of the free and used space on your computer is what every user should do in order for his computer to work as long as possible.
In this article, we will show you in detail how to view statistics on the use of space on your machine using the native Ubuntu disk analyzer.
But first, let’s find the answer for the following question:

Why is it important to keep track of Linux disk space?

It is worth knowing that partitions in Linux can be 100% full, but even so, the system can continue to work.
But even if the system works fine, this does not mean that you will not run into problems when working with certain services.
It is also important to keep track of Ubuntu free disk space and not constantly use all the available space on your computer in order to extend the life of your hardware.

How to check Linux disk space using the terminal?

Now there are quite a few different applications for analyzing Ubuntu space and you can use any third-party disk analyzer Linux (Linux disk analyzer) but we will show you how you can easily and quickly check the space on your computer using the terminal.
We will look at 2 useful commands – df and du. First, you need to launch the terminal: use Ctrl+Alt+T.

df

Type df in the terminal and press the “Enter” button.
At first glance, what you see can seem rather incomprehensible. But do not rush, now we will tell you what each column means.
So, you see 6 columns on the monitor.
The 1st is the filesystem. Here you will see the filesystem name.
The 2nd one is the number of 1K blocks. There you will see a number of 1K blocks available on that filesystem.
The 3rd one is also the number of 1K blocks. But here you will see the number of used 1K blocks on that filesystem.
The 4th one is again the number of 1K blocks. Here you will see the number of 1K blocks that are not used yet.
The 5th one is the number that shows you how much space is used in that filesystem but as a percentage.
The 6th one is the name of the filesystem.
And the last column is where the system is mounted.
If this command still does not suit you and you find it difficult to understand its output, you can use another command that will make it easier to Ubuntu check disk space (check disk space in Ubuntu) and find out what is taking up space:

df -h

This command makes the output human-readable and displays the size of filesystems in kilobytes, megabytes and gigabytes.

df -BK

If you want the sizes of filesystems to be displayed in specific units of measurement, then you should use this command.
For example, if you write “df -BK”, the size will be displayed in kilobytes, if you write “df – BM”, the size will be displayed in megabytes, if you write “df – BG”, the size will be displayed in gigabytes and so on.

df -i

To see the information presented in the number of inodes, you can enter the command df -i.
You may not need this information, but some users want to keep track of these parameters.
Another useful command that will help you to check disk space Ubuntu (check disk space in Ubuntu) is du.

du

If you just enter this command in the terminal without any options, you will see two columns on your display. The first contains the size of the directory, and the second lists all directories and subdirectories.
As you can imagine, this way of displaying data is not very convenient, because, most likely, you will see a very long list in front of you, which will obscure your entire display and even more.
To make it easier for you to read this data, we suggest you use the following command:

du -h

Just like df -h, du -h makes the output human-readable and displays the size of directories in kilobytes, megabytes and gigabytes. This allows you to quickly find out what size each directory is taking up in a more familiar way.

du -BK

This command also displays the size of directories in specific units of measurement, just like the df -BK command.
For example, if you write “df -BK”, the size will be displayed in kilobytes, if you write “df – BM”, the size will be displayed in megabytes, if you write “df – BG”, the size will be displayed in gigabytes and so on.

du -s

If you want to see how much space each directory takes up without displaying subdirectories, you should use this command so that the list of directories does not take up too much space on your display.

Conclusion

So, you have learned about the ways by which you can check the free and used space on your computer without any third-party Ubuntu disk analyzer, but only with system tools. As you may have noticed, the commands for the terminal are quite different, but you can definitely choose for yourself the ones that will be most convenient for you to use.
Check the Ubuntu space on your computer, make sure that the memory is not full, so that your machine can more efficiently perform the tasks you need.

Similar Articles

How to increase Google Drive space for free
Contents Google Drive is a rather popular cloud storage among many users now. This service provides various useful options that can make your work more convenient and it constantly attracts new users. In this article, we will analyze why Google…
How to Free up Space on Android - Android Free up Space
Contents Effective ways to‌ ‌free‌ ‌up‌ ‌space‌ ‌on‌ ‌an‌ ‌Android‌ ‌device‌ There comes a time when every mobile phone user enters the query "how to clear space on an android phone?" into the Google search request. Many programs are designed…
How to free up space on iphone
Contents In the modern world, a large number of people use iPhones. These devices can always be with you and help store a large amount of information, whether it's photos, videos, music, mobile apps, contacts, files and other types of…

Frequently Asked Questions

Start Dissy. The application will automatically open in the “Scan & Analyze tab”. There you will see a list of all drives connected to your computer. Click on the "Scan Storage" button next to the drive you want to scan, and the program will start scanning. To scan a specific folder, you can open it through the menu at the bottom of the window.
To fix this problem, open a terminal, enter «sudo nano /etc/hosts», then enter «127.0.0.1 localhost» and save.
Dissy is fully compatible with Windows, Mac and Linux operating systems. So it can be used on almost any machine.
Yes, it is possible. To prevent the folder from being scanned, it must be added to the “Important” section. To do this, you need to scan the folder in which the folder you need is located, and opposite it in the menu select “Add to Important”. Thus, the selected folder will not participate in further scans, and you will not be able to accidentally make changes to it or delete it.