How to Install Duf on Almalinux 9

Duf also called "Disk Usage Free utility" is a free and open-source tool written in Golang. It is used to display disk usage of the system in a tabular format. It is an alternative to the df command and it can be installed on Linux, BSD, Windows, and macOS. It also displays the disk usage details in the JSON output.

In this post, we will show you how to monitor disk usage with the Duf utility on Almalinux 9.

Prerequisites

  • A system with Almalinux 9 installed and running.
  • root access to the system.

Check for System Updates

First, we will update the system to the latest with the following commands,

dnf update

Install Duf

At the time of writing this article, version 0.8.1 was the latest. You can check and download the latest version of .deb source file from their official repository.

We will download using the wget command as shown below,

wget https://github.com/muesli/duf/releases/download/v0.8.1/duf_0.8.1_linux_amd64.rpm

Output:

[root@server ~]# wget https://github.com/muesli/duf/releases/download/v0.8.1/duf_0.8.1_linux_amd64.rpm
--2022-07-23 22:09:37--  https://github.com/muesli/duf/releases/download/v0.8.1/duf_0.8.1_linux_amd64.rpm
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.109.133, 185.199.108.133, 185.199.110.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 916883 (895K) [application/octet-stream]
Saving to: ‘duf_0.8.1_linux_amd64.rpm’

duf_0.8.1_linux_amd 100%[===================>] 895.39K  --.-KB/s    in 0.08s

2022-07-23 22:09:37 (11.1 MB/s) - ‘duf_0.8.1_linux_amd64.rpm’ saved [916883/916883]

Install the downloaded rpm source file using the command,

rpm -Uvh duf_0.8.1_linux_amd64.rpm

Output:

[root@vps ~]# rpm -Uvh duf_0.8.1_linux_amd64.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:duf-0:0.8.1-1                    ################################# [100%]

Using the Duf Command Utility

We will now try using the duf command on the terminal to get disk-related information.

duf

Output:

[root@server ~]# duf
╭────────────────────────────────────────────────────────────────────╮
│ 2 local devices                                                    │
├────────────┬────────┬────────┬────────┬────────┬──────┬────────────┤
│ MOUNTED ON │   SIZE │   USED │  AVAIL │  USE%  │ TYPE │ FILESYSTEM │
├────────────┼────────┼────────┼────────┼────────┼──────┼────────────┤
│ /          │  48.5G │   1.3G │  47.1G │   2.8% │ xfs  │ /dev/vda4  │
│ /boot      │ 506.7M │ 219.1M │ 287.6M │  43.2% │ xfs  │ /dev/vda2  │
╰────────────┴────────┴────────┴────────┴────────┴──────┴────────────╯
╭─────────────────────────────────────────────────────────────────────╮
│ 4 special devices                                                   │
├─────────────┬────────┬──────┬────────┬────────┬────────┬────────────┤
│ MOUNTED ON  │   SIZE │ USED │  AVAIL │  USE%  │ TYPE   │ FILESYSTEM │
├─────────────┼────────┼──────┼────────┼────────┼────────┼────────────┤
│ /dev        │ 869.1M │   0B │ 869.1M │        │ devtmp │ devtmpfs   │
│             │        │      │        │        │ fs     │            │
│ /dev/shm    │ 887.5M │   0B │ 887.5M │        │ tmpfs  │ tmpfs      │
│ /run        │ 355.0M │ 9.3M │ 345.6M │   2.6% │ tmpfs  │ tmpfs      │
│ /run/user/0 │ 177.5M │   0B │ 177.5M │        │ tmpfs  │ tmpfs      │
╰─────────────┴────────┴──────┴────────┴────────┴────────┴────────────╯

Next, Find out more duf usages and available options that you can use to get started,

duf --help

To display the information about Pseudo, inaccessible, and duplicate file systems, run the following command:

duf -all

Output:

[root@server ~]# duf -all
╭────────────────────────────────────────────────────────────────────────╮
│ 3 local devices                                                        │
├──────────────┬────────┬────────┬────────┬────────┬────────┬────────────┤
│ MOUNTED ON   │   SIZE │   USED │  AVAIL │  USE%  │ TYPE   │ FILESYSTEM │
├──────────────┼────────┼────────┼────────┼────────┼────────┼────────────┤
│ /            │  48.5G │   1.3G │  47.1G │   2.8% │ xfs    │ /dev/vda4  │
│ /boot        │ 506.7M │ 219.1M │ 287.6M │  43.2% │ xfs    │ /dev/vda2  │
│ /sys/fs/seli │     0B │     0B │     0B │        │ selinu │ selinuxfs  │
│ nux          │        │        │        │        │ xfs    │            │
╰──────────────┴────────┴────────┴────────┴────────┴────────┴────────────╯
╭───────────────────────────────────────────────────────────────────────╮
│ 19 special devices                                                    │
├──────────────┬────────┬──────┬────────┬────────┬────────┬─────────────┤
│ MOUNTED ON   │   SIZE │ USED │  AVAIL │  USE%  │ TYPE   │ FILESYSTEM  │
├──────────────┼────────┼──────┼────────┼────────┼────────┼─────────────┤
│ /dev         │ 869.1M │   0B │ 869.1M │        │ devtmp │ devtmpfs    │
│              │        │      │        │        │ fs     │             │
│ /dev/hugepag │     0B │   0B │     0B │        │ hugetl │ hugetlbfs   │
│ es           │        │      │        │        │ bfs    │             │
│ /dev/mqueue  │     0B │   0B │     0B │        │ mqueue │ mqueue      │
│ /dev/pts     │     0B │   0B │     0B │        │ devpts │ devpts      │
│ /dev/shm     │ 887.5M │   0B │ 887.5M │        │ tmpfs  │ tmpfs       │
│ /proc        │     0B │   0B │     0B │        │ proc   │ proc        │
│ /proc/sys/fs │     0B │   0B │     0B │        │ autofs │ systemd-1   │
│ /binfmt_misc │        │      │        │        │        │             │
│ /proc/sys/fs │     0B │   0B │     0B │        │ binfmt │ binfmt_misc │
│ /binfmt_misc │        │      │        │        │ _misc  │             │
│ /run         │ 355.0M │ 9.3M │ 345.6M │   2.6% │ tmpfs  │ tmpfs       │
│ /run/user/0  │ 177.5M │   0B │ 177.5M │        │ tmpfs  │ tmpfs       │
│ /sys         │     0B │   0B │     0B │        │ sysfs  │ sysfs       │
│ /sys/fs/bpf  │     0B │   0B │     0B │        │ bpf    │ none        │
│ /sys/fs/cgro │     0B │   0B │     0B │        │ cgroup │ cgroup2     │
│ up           │        │      │        │        │ 2      │             │
│ /sys/fs/fuse │     0B │   0B │     0B │        │ fusect │ fusectl     │
│ /connections │        │      │        │        │ l      │             │
│ /sys/fs/psto │     0B │   0B │     0B │        │ pstore │ pstore      │
│ re           │        │      │        │        │        │             │
│ /sys/kernel/ │     0B │   0B │     0B │        │ config │ configfs    │
│ config       │        │      │        │        │ fs     │             │
│ /sys/kernel/ │     0B │   0B │     0B │        │ debugf │ debugfs     │
│ debug        │        │      │        │        │ s      │             │
│ /sys/kernel/ │     0B │   0B │     0B │        │ securi │ securityfs  │
│ security     │        │      │        │        │ tyfs   │             │
│ /sys/kernel/ │     0B │   0B │     0B │        │ tracef │ tracefs     │
│ tracing      │        │      │        │        │ s      │             │
╰──────────────┴────────┴──────┴────────┴────────┴────────┴─────────────╯

Done!


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS