The Duf disk utility is an open-source, free “Disk Usage Free Utility” written in Goland and released under an MIT license. The disk utility supports multi-platforms such as BSD, Linux, macOS, and Windows operating systems. One of the excellent features of Duf is its ability to display disk usage details in a beautiful, user-friendly layout in tab form. Some extra features with Duf include disk usage in JSON output for further integrations with other programs or scripting languages. Duf is an excellent tool for system administrators to keep track of their server’s disk space or for general users to keep track of the space on their computer’s hard drive. Overall, the features and usability of Duf make it an excellent program for managing and understanding your computer’s disk usage.
The following tutorial will teach you how to install Duf on Arch Linux using the command line terminal. The tutorial will also focus on some common-use commands.
Table of Contents
Update Arch Linux
Before you proceed, run a quick update to ensure all packages are up-to-date to avoid conflicts.
sudo pacman -Syu
Sometimes, you may need a complete database download if you have not upgraded your Arch Linux system for a while; use the following command if the above update command does not work.
sudo pacman -Syyu
Lastly, Arch Linux being a rolling release, on the rare occasion when updating packages with Pacman GPG keys can become invalid or corrupt. If both commands do not work, use the following command.
sudo pacman -S archlinux-keyring
Once done, use one of the two commands above to check and proceed to upgrade your Arch Linux system.
Install Duf Disk Usage Utility
Duf is, by default, available on Arch Linux official repositories, making the installation straightforward without needing packages from the AUR, for example.
sudo pacman -S duf
The overall process should not take longer than a few minutes at most.
Once installed, confirm the version and build of Duf by using the following.
Duf Disk Usage Utility Commands Basics & Examples
Now that you have installed Duf Disk Utility, you can begin using the utility. The following commands are some examples you can do with Duf.
First, access the display using the following command.
Alternatively, if you would like to display all system files, including those that are duplicates, pseudo, and hidden, use the following command.
Duf can also have the ability to scale down and sort out specifics of what you would like to see and or check on with keywords.
The example format syntax would be with replacing <keyword>.
duf --output <keyword>
Using keywords would be mount point, size, and usage options. You can use all three together or individually, and any combination is possible.
Example of the mount point, size, and usage:
duf --output mountpoint,size,usage
You can go into details about specific directory paths, such as finding the size of two locations.
duf /home /var
Sometimes you may feel overwhelmed and want to hide or show certain information only. This can be done by adding –only or –hide.
duf --only local,network,fuse,special,loops,binds duf --hide local,network,fuse,special,loops,binds
For customization, you can change the color from light to dark and vice versa; this is for users with desktop environments installed only; theme commands will not work for a headless environment.
Activate light theme:
duf --theme light
Activate dark theme:
duf --theme dark
Lastly, you can access the Duf JSON features using the following command.
To access the help menu to find out more about a command or general information, use the following command.
Usage of duf: -all include pseudo, duplicate, inaccessible file systems -avail-threshold string specifies the coloring threshold (yellow, red) of the avail column, must be integer with optional SI prefixes (default "10G,1G") -hide string hide specific devices, separated with commas: local, network, fuse, special, loops, binds -hide-fs string hide specific filesystems, separated with commas -hide-mp string hide specific mount points, separated with commas (supports wildcards) -inodes list inode information instead of block usage -json output all devices in JSON format -only string show only specific devices, separated with commas: local, network, fuse, special, loops, binds -only-fs string only specific filesystems, separated with commas -only-mp string only specific mount points, separated with commas (supports wildcards) -output string output fields: mountpoint, size, used, avail, usage, inodes, inodes_used, inodes_avail, inodes_usage, type, filesystem -sort string sort output by: mountpoint, size, used, avail, usage, inodes, inodes_used, inodes_avail, inodes_usage, type, filesystem (default "mountpoint") -style string style: unicode, ascii (default "unicode") -theme string color themes: dark, light, ansi (default "dark") -usage-threshold string specifies the coloring threshold (yellow, red) of the usage bars as a floating point number from 0 to 1 (default "0.5,0.9") -version display version -warnings output all warnings to STDERR -width uint max output width
How to Update/Upgrade Duf Disk Usage Utility
Since you have imported the official Pacman repository, updating Duf is quick and straightforward; run the following standard commands as you would updating any other system package.
sudo pacman -Syu
How to Remove (Uninstall) Duf Disk Usage Utility
When you no longer require Duf installed on your system, use the following command to remove it.
sudo pacman -Rs duf
The above command will remove Duf and any unused dependencies not used by any other installation.
Comments and Conclusion
Duf is a very user-friendly and efficient disk utility with many excellent features. The tab layout makes it easy to compare different directories, and the JSON output is great for developers or anyone who wants more detailed information about their disk usage. We highly recommend giving Duf a try if you’re looking for an open-source, free disk utility that supports multiple platforms.