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
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.