What is taking up disk space on Linux?

Table of Contents

Computers are quite advanced machines these days. But even they can face the problem of insufficient memory on the hard disk. To understand how to fix this problem, you need to understand what exactly takes up space on your computer. In this article, we will talk and show you how to find out what is using disk space in Linux.

Why do I need to free up disk space?

Freeing up your disk space can help you deal with many problems. By deleting unnecessary and old files, you not only free up space for new ones, but you can also improve the performance of your computer. If your computer has an SSD drive, it is especially important to keep track of how full it is. SSD drives can age quickly if they use more than 90% of the memory.

How to find out what is taking up disk space on Linux:

Method 1:
To find out the size of files and directories, you can use the du (short disk usage) command.
Write du -sh * and the output will look like this:
342 folder
628 folder1
99 file.sh
What do the -sh * keys mean:
-s – displays the size only for the folder passed as an argument, not for each file in that folder.
-h – displays the sizes in a human-readable form (2K, 18M, 4G)
* – selects all objects in the current directory for counting.
To take a closer look at a folder, use the following syntax to navigate deeper into the folder:
du / path_to_directory
For example, du -ah/var / log
-a – displays the size for all files, not just directories.
This method may not seem convenient enough, so we will look at the second option.
Method 2:
Using the ncdu command (NCurse Disk Usage)
You can install ncdu through the terminal with the «sudo apt-get install ncdu» command.
Enter the command and wait for it to calculate the used space.
The results will be displayed as a list with the relative path and size of each object.
The ncdu command has a pseudographic interface, that is why it will be easier and more convenient to use it.
The arrow keys are used to navigate. Use the up and down keys to select an item, and use the left and right keys or the Enter key to enter the selected categories.
Another distinguishing feature of the ncdu command is the hotkeys that are used for control.
Some of them are presented below:
a – switching to the mode of displaying the actual used disk space in bytes
q and b – exit the program to the console
d – delete the selected object
e – show only hidden files
g – switch to the mode of displaying the used place as a percentage
i – display information about a file or folder
k and j – same as up-down keys
n and s – sort by name and size
r – recalculation of used space

Unfortunately, both methods do not have a convenient graphical interface, and therefore it is not so easy to work with them in order to find out what is taking up disk space.
There are many third-party utilities that have a great interface and advanced functionality. With them, you can easily and visually be able to find out what is taking up disk space on your computer.

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 « 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.