The Disk Usage Free utility, commonly known as Duf, is a powerful, open-source tool designed in Golang for monitoring disk usage across various systems. Duf offers a visually appealing, tabular presentation of disk usage data, serving as a modern alternative to the traditional ‘df’ command. It is versatile, supporting installation on Linux, BSD, Windows, and macOS, and can also output disk usage details in JSON format.
This article guides you through installing and using Duf on an Ubuntu 20.04 server for disk usage monitoring.
Prerequisites
- An Ubuntu 20.04 server setup.
- Root access for administration tasks.
Getting Started
Before installing any package, update your package cache to ensure access to the latest versions. Execute the following command:
apt-get update -y
Once the package cache is updated, proceed with the installation steps.
Install Duf
As Duf is not in the default Ubuntu repositories, you must download it from its official GitHub release page using this command:
wget https://github.com/muesli/duf/releases/download/v0.6.2/duf_0.6.2_linux_amd64.deb
After the download completes, install the package using:
dpkg -i duf_0.6.2_linux_amd64.deb
How to Use Duf
This section demonstrates different ways to monitor disk usage using Duf. Run the Duf command without options to view all logical partitions and filesystems:
duf
Expected output:
[Duf output showing logical partitions and filesystems]
To check the disk usage for specific directories, such as /etc and /usr, execute:
duf /etc /usr
Expected output:
[Duf output showing specific directory usage]
Include Pseudo, inaccessible, and duplicate filesystems with:
duf -all
Expected output:
[Duf extended filesystem output]
For Inode usage details, use:
duf --inodes
Expected output:
[Duf Inode usage output]
Arrange disk usage information by size with:
duf --sort size
Expected output:
[Duf sorted by size output]
Display selected columns using:
duf --output mountpoint,size,used,avail,filesystem
Expected output:
[Duf output with selected columns]
For a comprehensive list of Duf options, run:
duf --help
Expected output:
[Duf help output]
Conclusion
You’ve learned how to install and utilize Duf on Ubuntu 20.04 for efficient disk usage monitoring. This utility offers an aesthetically pleasing and user-friendly way to manage disk data, making system management more intuitive.
FAQ
What are the benefits of using Duf over the traditional ‘df’ command?
Duf provides a more user-friendly and visually appealing layout, supports JSON output for extended use cases, and offers more filtering and sorting capabilities than the ‘df’ command.
Can Duf be used on other operating systems besides Ubuntu 20.04?
Yes, Duf can be installed and used on Linux, BSD, Windows, and macOS platforms.
Is the data output by Duf customizable?
Absolutely. Duf allows users to sort and filter data, display specific columns, and output results in JSON format, providing a highly customizable data presentation experience.