Am I a command line ninja? Hardly, but I do enjoy using command line tools on Linux, especially as they can often be much faster to use than full-fat GUI alternatives.
At the end of 2021 I wrote a list of the best command line apps I use often. That rundown showcases tools like btop (a powerful and engaging alternative to top) and intro’d ncdu (a fast and interactive replacement to the standard du command).
This week I came across an equally flashy “replacement” to another common Linux command I — and I’m sure many of you — run from time to time: df.
Df shows file system disc space usage on a(ll) drive(s). Ample options let you tailor the output of df to suit your needs (something the df man-page walks through more succinctly than a waffle-merchant like I could).
But while df is powerful, its presentation is a little lacklustre. It can show a lot of information, but it can’t show it very clearly – which is where Duf comes in.
Duf is a Neat Df Alternative
Meet Duf (the name stands for Disk Usage/Free), a command-line tool pitching itself as “a better df alternative”.
And for my needs, it is.
Duf features:
- User-friendly, colorful output
- Adjusts to your terminal’s theme & width
- Sort results according to your needs
- Groups & filters devices
- Can conveniently output JSON
As I’ve said: regular ol’ df is good at what it does, but it’s also utilitarian.
I much prefer the way duf presents information. It’s ordered, and more intelligible at-a-glance.
I find the presentation of duf (above) easier to parse than the rows returned by the standard df command. You’d think showing me more information off the bat it’d be harder to find the information I need, yet… The exact opposite.
What’s especially great is that it is easy to install ‘duf’ on Ubuntu 22.04 LTS and later:
sudo apt install duf
To run it:
duf
Remember: duf is as concise or as expansive as you need. Pass it the --all option and it goes from short and sweet to long and detailed:
Run duf --help for a full overview of everything it can do, or stop by the GitHub page to learn more (where you can also download an installer to use on an older version of Ubuntu, or a Linux distribution that doesn’t package it).
Summary
Switching to Duf will change the way people use their computer forever —no, just kidding!
Most of us don’t use tools like df (much less this replacement) often enough. For those times you do want to probe the amount of free space on your mounted file system(s), it’s a solid choice.
Go try it out then let me know what you think of it by leaving a comment.
