How to install and use the duf command on Linux

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Want a more complete alternative to the du command? Well, in this post, we will show it to you because you will learn how to install and use the duf command on Linux.

Introduction

duf is a Disk Usage/Free Utility that is written in Go and is meant to be a solid alternative to the df command by presenting the information in a more user-friendly way.

Some of its main features are the following:

  • User-friendly, colorful output
  • Adjusts to your terminal’s theme & width
  • Sort the results according to your needs
  • Groups & filters devices
  • Can conveniently output JSON

It is worth noting that the tool not only works on Linux systems, but can be used on BSD, macOS, Windows, and Android.

So, it is almost a must to know how to install it to get further information about disk usage.

Let’s go.

Install duf on Linux

We can install duf from many methods and even from the official repositories of Linux distributions.

In the case of Debian (unstable), Ubuntu, Linux Mint and other members of the family

sudo apt update
sudo apt install duf

If you are using Arch Linux, Manjaro or another derivative

sudo pacman -S duf

But don’t worry, there are packages DEB and RPM to support many other distributions.

Also on the tool’s GitHub site, you can find instructions on how to compile it and generate the binary yourself.

Using the duf command on Linux

Once you have already installed the duf command using any possible method for it, you can use it by executing in the terminal

duf

You will get an output screen like this

Using the duf command
Using the duf command

If you want to learn more ways to use it, you can show the help with the following command

duf --help
the command help
the command help

If you would like to list everything (including pseudo, duplicate, inaccessible file systems):

duf --all
duf option
duf option

By adding arguments, you can display information about those locations

duf /home /var

As the information is massive, you can filter it by choosing what to show and what to hide.

duf --only local,network,fuse,special,loops,binds
duf --hide local,network,fuse,special,loops,binds

Another way to improve the results, is to sort it by specific criteria. For example:

duf --sort size
Sort option with duf
Sort option with duf

But you can use more criteria mountpoint, size, used, avail, usage, inodes, inodes_used, inodes_avail, inodes_usage, type, filesystem.

And to use the JSON features

duf --json

So, enjoy it.

Conclusion

In this post, you learned about the duf command on Linux. Therefore, you can know the disk space occupied on Linux and in a specific location.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Angelo
Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook