Duf is a modern and user-friendly disk usage/free utility that provides an intuitive way to view your disk space usage. It offers a clear and concise display, showing available, used, and total space for all mounted file systems. Duf is designed to be a more visually appealing and informative alternative to traditional disk usage tools, making it ideal for casual users and system administrators.
The following guide will demonstrate the steps to install Duf on Ubuntu 24.04, 22.04, and 20.04 LTS distributions using the command-line terminal. The installation method involves using Ubuntu’s default repository, ensuring you get the most up-to-date version available.
Update Ubuntu Before Duf Installation
Before installing DUF, you must update your Ubuntu system to ensure that all existing packages are up-to-date. This helps prevent any conflicts or issues during the installation process.
To update your system, run the following command:
sudo apt update && sudo apt upgrade
Install Duf via APT Command
The easiest way to install DUF is by using the Ubuntu default repository. DUF does not have frequent updates, making this method the most convenient option for installation.
Run the following command to install DUF on your system:
sudo apt install duf
Getting Started With Duf: Basic Commands
This section will explore the basic and advanced usage of DUF commands to help you understand and utilize the tool effectively. As your guide, we will explain each step and provide examples to ensure you gain a solid grasp of DUF’s capabilities.
Display Disk Usage with Default Settings
Let’s use the most straightforward command for DUF, which displays disk usage with the default settings. Type duf
in the terminal and press Enter:
duf
This command will display an overview of your system’s disk usage, including information on filesystem types, mount points, sizes, and usage percentages.
Filter Results by Filesystem Type
You can filter the output by filesystem type to focus on specific storage devices or systems. Use the --only-fs
flag followed by the desired filesystem type:
duf --only-fs ext4
This command will display disk usage information for only ext4
filesystems.
Customize Output Columns
DUF allows you to customize the displayed columns, providing a tailored view of the disk usage information. Use the --output
flag followed by the desired column names separated by commas:
duf --output size,used,avail,mountpoint
This command will display the output’s size, used space, available space, and mount point columns.
Advanced Usage with Multiple Flags
You can combine multiple flags to create more complex and customized queries. For example, to display only ext4
filesystems, sorted by size, and with specific columns:
duf --only-fs ext4 --sort size --output size,used,avail,usage,mountpoint
This command demonstrates the flexibility and power of DUF, allowing you to create customized views that suit your specific needs.
Display All Filesystems
By default, DUF displays only local filesystems. To display all filesystems, including remote and special ones, use the --all
flag:
duf --all
This command will provide an overview of all filesystems present on your system.
Display Inode Usage
DUF can also display inode usage information. Inodes are essential filesystem structures that store metadata about files and directories. To view inode usage, use the --inodes
flag:
duf --inodes
This command will display inode usage information, including the total number of inodes, used inodes, and the inode usage percentage.
Display Help and Available Options
To view the help documentation and available options, use the --help
flag:
duf --help
This command will display a list of available flags and options, offering a quick reference for customizing DUF’s output.
Show Version Information
To display the installed version of DUF, use the --version
flag:
duf --version
This command will show the DUF version, helping you use the latest release with all available features and improvements.
Conclusion
This guide covered installing and using DUF on Ubuntu 24.04, 22.04, and 20.04 LTS. You’ve set up a robust disk usage monitoring tool, helping you manage your system’s disk space effectively. DUF’s customization options and user-friendly interface make it valuable for all users. Continue exploring its features to improve your system administration skills.