How to Install Duf on Almalinux 8

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 8.

Prerequisites

  • A system with Almalinux 8 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,

yum 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 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@vps ~]# duf
╭───────────────────────────────────────────────────────────────────────────────────────╮
│ 1 local device                                                                        │
├────────────┬───────┬──────┬───────┬───────────────────────────────┬──────┬────────────┤
│ MOUNTED ON │  SIZE │ USED │ AVAIL │              USE%             │ TYPE │ FILESYSTEM │
├────────────┼───────┼──────┼───────┼───────────────────────────────┼──────┼────────────┤
│ /          │ 48.7G │ 2.6G │ 43.6G │ [#...................]   5.3% │ ext4 │ /dev/vda1  │
╰────────────┴───────┴──────┴───────┴───────────────────────────────┴──────┴────────────╯
╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 5 special devices                                                                                │
├────────────────┬────────┬───────┬────────┬───────────────────────────────┬──────────┬────────────┤
│ MOUNTED ON     │   SIZE │  USED │  AVAIL │              USE%             │ TYPE     │ FILESYSTEM │
├────────────────┼────────┼───────┼────────┼───────────────────────────────┼──────────┼────────────┤
│ /dev           │ 892.6M │    0B │ 892.6M │                               │ devtmpfs │ devtmpfs   │
│ /dev/shm       │ 908.5M │    0B │ 908.5M │                               │ tmpfs    │ tmpfs      │
│ /run           │ 908.5M │ 19.8M │ 888.7M │ [....................]   2.2% │ tmpfs    │ tmpfs      │
│ /run/user/0    │ 181.7M │    0B │ 181.7M │                               │ tmpfs    │ tmpfs      │
│ /sys/fs/cgroup │ 908.5M │    0B │ 908.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@vps ~]# duf -all
╭─────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 2 local devices                                                                                 │
├─────────────────┬───────┬──────┬───────┬───────────────────────────────┬───────────┬────────────┤
│ MOUNTED ON      │  SIZE │ USED │ AVAIL │              USE%             │ TYPE      │ FILESYSTEM │
├─────────────────┼───────┼──────┼───────┼───────────────────────────────┼───────────┼────────────┤
│ /               │ 48.7G │ 2.6G │ 43.6G │ [#...................]   5.3% │ ext4      │ /dev/vda1  │
│ /sys/fs/selinux │    0B │   0B │    0B │                               │ selinuxfs │ selinuxfs  │
╰─────────────────┴───────┴──────┴───────┴───────────────────────────────┴───────────┴────────────╯
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 30 special devices                                                                                                    │
├─────────────────────────────────┬────────┬───────┬────────┬───────────────────────────────┬─────────────┬─────────────┤
│ MOUNTED ON                      │   SIZE │  USED │  AVAIL │              USE%             │ TYPE        │ FILESYSTEM  │
├─────────────────────────────────┼────────┼───────┼────────┼───────────────────────────────┼─────────────┼─────────────┤
│ /dev                            │ 892.6M │    0B │ 892.6M │                               │ devtmpfs    │ devtmpfs    │
│ /dev/hugepages                  │     0B │    0B │     0B │                               │ hugetlbfs   │ hugetlbfs   │
│ /dev/mqueue                     │     0B │    0B │     0B │                               │ mqueue      │ mqueue      │
│ /dev/pts                        │     0B │    0B │     0B │                               │ devpts      │ devpts      │
│ /dev/shm                        │ 908.5M │    0B │ 908.5M │                               │ tmpfs       │ tmpfs       │
│ /proc                           │     0B │    0B │     0B │                               │ proc        │ proc        │
│ /proc/sys/fs/binfmt_misc        │     0B │    0B │     0B │                               │ binfmt_misc │ binfmt_misc │
│ /proc/sys/fs/binfmt_misc        │     0B │    0B │     0B │                               │ autofs      │ systemd-1   │
│ /run                            │ 908.5M │ 19.8M │ 888.7M │ [....................]   2.2% │ tmpfs       │ tmpfs       │
│ /run/user/0                     │ 181.7M │    0B │ 181.7M │                               │ tmpfs       │ tmpfs       │
│ /sys                            │     0B │    0B │     0B │                               │ sysfs       │ sysfs       │
│ /sys/fs/bpf                     │     0B │    0B │     0B │                               │ bpf         │ bpf         │
│ /sys/fs/cgroup                  │ 908.5M │    0B │ 908.5M │                               │ tmpfs       │ tmpfs       │
│ /sys/fs/cgroup/blkio            │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/cpu,cpuacct      │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/cpuset           │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/devices          │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/freezer          │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/hugetlb          │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/memory           │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/net_cls,net_prio │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/perf_event       │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/pids             │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/rdma             │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/cgroup/systemd          │     0B │    0B │     0B │                               │ cgroup      │ cgroup      │
│ /sys/fs/pstore                  │     0B │    0B │     0B │                               │ pstore      │ pstore      │
│ /sys/kernel/config              │     0B │    0B │     0B │                               │ configfs    │ configfs    │
│ /sys/kernel/debug               │     0B │    0B │     0B │                               │ debugfs     │ debugfs     │
│ /sys/kernel/security            │     0B │    0B │     0B │                               │ securityfs  │ securityfs  │
│ /sys/kernel/tracing             │     0B │    0B │     0B │                               │ tracefs     │ none        │
╰─────────────────────────────────┴────────┴───────┴────────┴───────────────────────────────┴─────────────┴─────────────╯

Done!