Operations 15 min read

Master Linux Disk Space Analysis with ncdu, dust, duu, diskus & tin‑summer

This article introduces several Linux disk‑usage analysis tools—ncdu, dust, duu, diskus, and tin‑summer—detailing their installation on Ubuntu 21.10, key command‑line options, and practical usage examples for quickly identifying and cleaning large directories and files.

Efficient Ops
Efficient Ops
Efficient Ops
Master Linux Disk Space Analysis with ncdu, dust, duu, diskus & tin‑summer

This article introduces several Linux disk‑usage analysis tools—ncdu, dust, duu, diskus, and tin‑summer—explaining how to install them on Ubuntu 21.10, their most useful options, and typical commands for locating large directories and files.

1. ncdu

ncdu is a fast, ncurses‑based disk‑usage analyzer written in C. Install it with

# sudo apt-get install ncdu

. Common options include:

-h

: help information

-q

: quiet mode (refresh every 2 seconds)

-v

: print version

-x

: stay on the same filesystem

-e

: enable extended information

-r

: read‑only

-0,-1,-2

: UI level (0 = none, 2 = full ncurses)

--si

: use SI (base‑10) prefixes

--exclude PATTERN

: exclude files matching PATTERN

-X, --exclude-from FILE

: exclude patterns from a file

-L, --follow-symlinks

: follow symbolic links (not directories)

--exclude-caches

: exclude directories containing CACHEDIR.TAG

--exclude-kernfs

: exclude Linux pseudo‑filesystems (procfs, sysfs, cgroup…)

--confirm-quit

: ask for confirmation before quitting

--color SCHEME

: set colour scheme

Run

ncdu

inside a directory to launch an interactive terminal UI. Use the arrow keys or

Enter

to navigate, press

d

to delete a selected file or directory, and

q

to quit.

2. dust

dust (du + rust) is a Rust‑based, more visual replacement for

du

. Install it on Ubuntu 21.10 by downloading the latest

.deb

package and installing it with

# dpkg -i du-dust_0.7.1_amd64.deb

. Basic usage is simply

# dust

. Key options include:

-f

: count files/directories instead of disk size

-s

: show file length instead of blocks

-p

: display full directory paths

-h

: help

-i

: hide hidden files

-x

: stay on the same filesystem

-b

: suppress percentage bars

-c

: disable colour output

-r

: reverse tree order

-t

: show only specified file types

-V

: version

-d

: limit depth

-e

: include only files matching a regex (e.g.,

-e ".png$"

)

-X

: exclude files matching a regex

-n

: limit output to N lines (default 23)

-w

: set output width

Examples:

<code># dust -p</code>
<code># dust /bin /etc</code>
<code># dust -s</code>
<code># dust -n 10</code>

3. duu

duu (Directory Usage Utility) is a cross‑platform tool written in Python. Install it by downloading the source tarball, extracting it, and running the script. Example installation steps:

<code># wget https://github.com/jftuga/duu/archive/refs/tags/v2.22.tar.gz
# tar -zxvf v2.22.tar.gz
# cd duu-2.22
# python3 duu.py</code>

Key options include:

-h

: help

-b

: suppress summary/statistics (useful for sorting)

-e

: summarize file extensions

-q

: hide single directories

-s

: send processing status to STDERR

-n

: skip directories starting with “.”

-N

: no recursion

-f

: show file count per directory

-S

: display mean, median, mode, and standard deviation

-H

: human‑readable numbers

-T

: number of threads (useful for SAN)

-x

: exclude case‑insensitive strings (colon‑separated list)

-X

: exclude case‑insensitive regular expressions

-o

: output to CSV

Example usage to view a specific directory:

<code># python3 duu.py /etc/init.d/</code>

4. diskus

diskus is a small, fast Rust implementation that can replace

du -sh

. Install it via the .deb package:

<code># wget https://github.com/sharkdp/diskus/releases/download/v0.7.0/diskus_0.7.0_amd64.deb# dpkg -i diskus_0.7.0_amd64.deb</code>

Basic usage:

<code># du -sh /etc</code>

or simply:

<code># diskus</code>

Options include:

-j

: set thread count (default 3 × cores) and output format (decimal MB or binary MiB)

-v

: show filesystem errors

-b

: calculate apparent size instead of disk usage

-h

: help

-v

: version information

5. tin‑summer (sn)

tin‑summer, invoked as

sn

, is another Rust‑based du replacement that reads file sizes rather than disk usage and offers multithreaded performance on large directories. Install it via a curl script or Cargo:

<code># curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git vmchale/tin-summer</code>
<code># cargo install tin-summer</code>

Typical commands:

# sn f

: show sizes of files in the current directory (human‑readable by default)

# sn f &lt;path&gt;

: show sizes for a specific directory

# sn ar

: search for build artifacts

# sn ar -t200M

: find artifacts larger than 200 MiB

# sn sort $DIR -n12

: list the 12 largest entries in $DIR

tin‑summer provides colourised output, regex‑based exclusion, and easy‑to‑read formatting, making it a convenient alternative to the classic

du

command.

These tools give administrators faster, more interactive, or more feature‑rich alternatives to the traditional

du

command, helping quickly locate and clean up disk‑space hogs.

Linuxdisk usagencdudiskusdustduutin-summer
Efficient Ops
Written by

Efficient Ops

This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.