How to Install Duf on Ubuntu 24.04, 22.04 or 20.04

This guide will demonstrate how to install Duf on Ubuntu 24.04, 22.04, or 20.04 LTS Linux releases utilizing the command-line terminal with the APT Package Manager.

Duf, the Disk Usage/Free Utility, stands out as a modern, user-friendly command-line tool designed to provide a clear and concise overview of your file system’s storage space. Unlike traditional disk usage tools, Duf offers an enhanced visual experience with its colorful, organized output, making it easier for users to interpret data at a glance. Key features include:

  • Automatic Detection: Duf intelligently identifies mounted filesystems, including remote ones, without requiring manual input.
  • Customizable Displays: Users can tailor the output according to their needs, choosing what details to show or hide.
  • Export Capabilities: Supports exporting data in JSON format, facilitating integration with scripts or other tools.
  • Filtering Options: Offers the ability to exclude specific file systems or directories from the output for focused analysis.
  • Multi-Platform Support: Works seamlessly across various Linux distributions, ensuring broad applicability.
  • Interactive Mode: Navigate through disk usage information interactively for a more detailed examination.
  • Threshold Alerts: Set thresholds to get alerts on disk usage, helping in proactive space management.
  • Enhanced Accessibility: With support for color-blind modes, Duf ensures usability for all users.

Duf’s introduction into your toolkit enhances your ability to monitor and manage disk space efficiently, ensuring that you stay informed about your system’s health without getting lost in complex command syntax. The tool’s blend of functionality and simplicity makes it an invaluable asset for system administrators, developers, and casual users alike.

Let’s dive in to get Duf up and running on your Ubuntu system.

Install Duf on Ubuntu via APT

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 on Ubuntu

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

Basic Duf Commands on Ubuntu

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.

Additional Tips and Tricks with DUF on Ubuntu

This section will cover additional tips and tricks to help you make the most of DUF, ensuring you can easily monitor and manage your disk space.

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 ensure you use the latest release with all available features and improvements.

Conclusion

In this guide, we have walked you through the process of installing and using DUF on Ubuntu Linux. By following these steps, you have successfully set up a powerful and versatile disk usage monitoring tool, enabling you to understand better and manage your system’s disk space. Remember, DUF’s customization options and interactive interface make it a valuable utility for both beginners and experienced users alike. Keep exploring and mastering DUF to enhance your system administration skills further.

Leave a Comment


Your Mastodon Instance
Share to...