Unlike Windows, which has a unified C: drive structure, Linux file systems spread data across several root directories (like /var, /usr, and /home). When your Ubuntu system warns you that your disk space is running dangerously low, randomly clicking through folders in the file manager to find the culprit is incredibly inefficient. A massive log file or an abandoned Docker container image could be hiding deep inside a hidden system folder.
To quickly reclaim your storage, you need to identify exactly which files and directories are consuming the most megabytes. While there are terminal commands (like du and find) that can do this, Ubuntu provides a built-in, highly visual graphical tool that makes tracking down disk hogs incredibly simple.
Using the Disk Usage Analyzer (Baobab)
Ubuntu comes pre-installed with an official GNOME utility called Disk Usage Analyzer (also known internally as Baobab). This tool scans your entire hard drive and generates an interactive, colour-coded map of your storage consumption.
- Press the Super key (the Windows key) on your keyboard to open the Activities overview search bar.
- Type Disk Usage Analyzer into the search bar and press Enter to launch the application.
- When the window opens, you will see a list of your connected drives. Click on the Home folder icon if you only want to scan your personal files (Downloads, Documents, etc.), or click on the Computer (the hard drive icon representing the root
/directory) to scan the entire system. - The application will begin scanning. Depending on the size and speed of your hard drive, this could take anywhere from a few seconds to a couple of minutes.
Interacting with the Scan Results
Once the scan is complete, the tool presents the data in two ways: a traditional folder list on the left, and a circular “ring chart” graphic on the right.
- Look at the list on the left side of the screen. The folders are automatically sorted by size, with the largest directories at the very top.
- Click the small arrow next to a large folder (for example,
/home) to expand it and see which specific sub-folders inside it are taking up the space. - Alternatively, hover your mouse over the coloured blocks in the ring chart on the right. The innermost ring represents your main folders, and the outer rings represent the files inside them. The wider the block, the larger the file.
- Clicking on a block in the chart will instantly “zoom in” on that specific directory, filtering out the rest of the hard drive so you can focus on finding the exact file.
Deleting the Large Files
Once you have drilled down and identified a massive, unnecessary file (like an old ISO image or a forgotten video project), you can delete it directly from within the analyzer tool.
- In the list on the left side of the screen, locate the specific large file you want to remove.
- Right-click on the file’s name.
- Select Move to Trash from the context menu.
- If you delete a file from a system folder outside of your Home directory, you may be prompted to enter your administrator password.
Remember that moving a file to the Trash does not immediately free up space. You must open your file manager, navigate to the Trash bin, and empty it to permanently reclaim the storage capacity on your drive.