Analyze disk usage with Baobab
Cleanup
Unnecessary files and directories take up valuable space on hard disks or SSDs. Baobab lets you locate and remove data garbage at the push of a button.
Computer mass storage is getting bigger and cheaper. With the rapidly increasing capacity of hard disks, SSDs, and USB sticks, users are tempted to store even more information (with some of it soon forgotten).
To find your way through the data jungle, Linux offers command-line tools like du
or df
. However, these tools do not provide detailed information on where data is stored or which files are the biggest space hogs.
Baobab [1], also known as Disk Usage Analyzer, is a graphical, menu-driven viewer, which lets you quickly track down obsolete data and identify space hogs. Baobab also lets you remove useless files without requiring massive search overhead.
You can find Baobab in the package sources of virtually all popular Linux distributions. It is easy to install using your distribution's package management tools. Some distributions, such as Ubuntu, automatically install Baobab.
Although the tool works with the GTK+ toolkit, Baobab also works with GTK desktops other than Gnome. After installation, the tool will appear in your desktop's menu hierarchy as Disk Usage Analyzer.
Windows
When launched, Baobab opens the Devices & Locations window, which shows all the drives available on your system, regardless of their mount status. Here you can see a drive's size and capacity to the right of the drive designation, as well as a colored bar beneath that shows total drive utilization at a glance (Figure 1).
Clicking on a displayed drive opens a two-paned window that shows the selected drive's directory hierarchy in a tree structure on the left. Baobab again uses colored bars to indicate utilization, which ranges from red (almost full) to yellow (partially full) to green (almost empty). If a small triangle appears in front of the directory name, clicking on it expands the view to the next hierarchy level. To the right of the directory tree structure and utilization bar graphs, you will find each level's absolute size and the number of objects it contains.
In the right pane, the drive's space allocation is shown as a multilayer pie chart, with each layer representing a further hierarchy level. If you mouse over the pie chart, Baobab temporarily displays the corresponding subdirectories and the occupied storage capacity (Figure 2).
If you click on another directory in the tree view on the left, the view also changes in the right window segment. Using the two buttons at the bottom of the right pane, you can switch from a pie chart (the button on the left) to a tile graph (button on the right). If the view appears too detailed (or too general for complex hierarchies), you can also use the context menu to zoom in or out.
Administration
Baobab not only provides insight into the data carriers' structure and assignments, but it also supports basic administrative tasks. When you right-click on a desired directory in the right pane, a context menu pops up that allows you to open the current working directory in the desktop's file manager, letting you work with its data. Alternatively, you can move a selected directory (including all its subdirectories) directly from Baobab to the trash can.
The left tree view also provides administrative task functions via a context menu, which you open by right-clicking on the desired directory. However, the only options available from this pane are for saving the file path to the clipboard, moving the directory with its subdirectories to the trash can, or opening the folder.
On computers with large volumes of data stored in deeply nested structures, it makes sense to work with individual folders. To do this, click on the Scan Folder… option (located under the hamburger icon drop-down list in the top-right corner of the drive view) and then select the desired folder in the file manager. After closing the dialog, Baobab displays the folder contents in the usual way, with the selected folder appearing as the root directory in the tree structure.
Removed
In addition to scanning locally mounted media, Baobab also supports media analysis and data cleanups on remote computers. To connect to an external computer, select Other Locations located bottom left in the Select Folder dialog box (Figure 3).
The file manager now displays other systems found on the local network. You can connect to the remote computer by clicking on its icon; if this does not work, enter the server address in the input field in the bottom right corner.
After pressing Connect, Baobab opens the corresponding connection. The software then switches back to the main window and displays the contents of the remote computer or server, which can be used just like local files and directories.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.