Skip to content

[Linux] Using `duf` Command to Check Usage of Disk

Introduction

duf is a tool that offers a more “graphical representation” for checking disk space usage on Linux systems, with its name derived from Disk Usage/Free Utility. It’s worth mentioning that this tool can also be installed not only on Linux but also on MacOS and Windows.

If you have used Linux, you must be familiar with the df command, right? If we use df, we will see the following screen:

Although this provides a clear view of the disk usage, it’s not always the most intuitive, right? This is when you might want to consider installing duf!


How to Use

First, you need to install it. If your OS is based on Debian/Ubuntu, you can use the following command:

sudo apt install duf


If you are using RPM such as Fedora:

sudo dnf install duf



And then, we try to experience duf!

duf


Output:

Pretty nice, isn’t it? The usage status is clear at a glance.

Of course, you might say that this shows too much unnecessary information, right? Especially the temporary files generated by the disk, there’s no need to display them at all!

Therefore, we can also use the --hide-fs parameter to hide them. If you are sure you need to hide them for the long term, perhaps you can use the alias command to set it as a default parameter in places like ~/.bashrc.

duf --hide-fs tmpfs


Output:

Isn’t it much cleaner?

duf also has many other parameters that can be used. If you are interested, feel free to check them out using --help.


References


Read More

Tags:

Leave a Reply