
Master Your Disk Space: A Guide to the ‘di’ Command on Linux
If you’ve ever managed a Linux system, you’re undoubtedly familiar with the df command. It’s the go-to tool for checking disk space usage. While functional, its output can often be cryptic, with truncated mount points and a format that isn’t immediately intuitive. Fortunately, there’s a powerful, user-friendly alternative designed to make your life easier: the Disk Information tool, or di.
This command-line utility provides a clean, comprehensive, and highly readable overview of your disk usage. It’s a modern replacement for df that prioritizes clarity and useful information right out of the box.
Why ‘di’ is a Superior Alternative to ‘df’
The core advantage of di is its focus on human readability. Where df often requires extra flags like -h to make sense, di presents clear information by default.
Here are the key benefits of switching to di:
- Readability by Default: The command automatically displays sizes in the most appropriate units (KB, MB, GB, etc.), so you don’t have to do the mental math.
- No More Truncated Names: Unlike
df, which often cuts off long filesystem or mount point names,diintelligently formats its output to ensure you see the full name, preventing confusion. - Intuitive Visuals: The output includes a simple bar graph that gives you a quick visual representation of how full each disk is.
- Comprehensive Information: It can easily display the filesystem type, mount options, and other useful data without needing to remember complex flags.
- Powerful Sorting and Formatting: You can easily sort the output by any column—such as available space or percentage used—and even create custom output formats for scripting.
Getting Started: How to Install ‘di’
The di tool is a lightweight utility available in the default repositories of most major Linux distributions. Installation is typically a single command away.
For Debian, Ubuntu, and their derivatives:
sudo apt-get install di
For Red Hat, Fedora, CentOS, and similar systems:
sudo dnf install di
Once installed, you can start using it immediately.
Practical ‘di’ Command Examples
Let’s explore how to use di to monitor your system’s storage effectively.
The Basic Disk Report
Simply running the command without any options provides a beautifully formatted report of all standard mounted filesystems.
di
The output will look something like this, with clear columns for the filesystem, total size, used space, available space, percentage used, and the mount point.
Filesystem Mount Size Used Avail %Used Chart
/dev/sda1 / 457.8G 212.1G 222.4G 49% [****-----]
tmpfs /dev/shm 15.6G 1.4G 14.2G 9% [*--------]
/dev/sdb1 /mnt/backup 1.8T 895.2G 1.0T 49% [****-----]
Checking Inode Usage
Running out of inodes—the data structures that store information about files—can be just as critical as running out of disk space. A disk can be technically “full” if all its inodes are used, even if space is available. To check inode usage, use the -i flag.
di -i
This command will display the total number of inodes, how many are used, how many are available, and the usage percentage. This is an essential check for systems that handle millions of small files.
Sorting for Clarity
One of the most powerful features of di is its ability to sort data. This is invaluable for quickly identifying which filesystems are most critical. For example, to sort the output by the amount of used space in descending order, use the -s flag.
di -s used
This immediately brings the most heavily used partitions to the top of the list, allowing you to focus your attention where it’s needed most. You can sort by any column header, including avail, size, or %used.
Including All Filesystems
By default, di hides certain pseudo-filesystems (like procfs or sysfs) that have zero blocks, as they are not relevant for general storage monitoring. However, if you need a complete picture of everything mounted on your system, you can use the -a flag.
di -a
Adding a Grand Total
To see a summary of the total disk space across all listed filesystems, simply add the -t flag.
di -t
This will add a “Totals” row at the bottom of the report, giving you a quick, at-a-glance overview of your system’s aggregate storage capacity and usage.
Final Thoughts
While the df command has served administrators for decades, its limitations are clear in a modern context. The di command is more than just a replacement; it’s a significant upgrade that provides clearer, more actionable information with less effort.
For system administrators, developers, and anyone who values clarity and efficiency in the terminal, installing the ‘di’ command is a small change that yields significant productivity gains. It helps you spot storage issues faster, understand your system better, and present disk usage data in a way that is immediately understandable to anyone. Give it a try—you won’t want to go back.
Source: https://www.linuxlinks.com/di-disk-information-tool/


