LinuxCommandLibrary

dysk

Show disk space usage

TLDR

Get a standard overview of your usual disks

$ dysk
copy

Sort by free size
$ dysk [[-s|--sort]] free
copy

Include only HDD disks
$ dysk [[-f|--filter]] 'disk = HDD'
copy

Exclude SSD disks
$ dysk [[-f|--filter]] 'disk <> SSD'
copy

Display disks with high utilization or low free space
$ dysk [[-f|--filter]] 'use > 65% | free < 50G'
copy

SYNOPSIS

dysk [OPTIONS] [QUERY] PATH

PARAMETERS

-h, --help
    Print help information

-V, --version
    Print version information

-i, --index
    Path to index SQLite database

--index-at
    Index PATH and write database to INDEX

-d, --db
    Path to SQLite database file

--threads
    Number of indexing threads (default: CPU cores)

--no-progress
    Disable progress bars

--color
    Color mode: always|never|auto (default: auto)

--dashboard
    Open interactive TUI dashboard

--delete
    Enable deletion in dashboard (dangerous)

-v, --verbose
    Verbose output

--json
    Output results as JSON

DESCRIPTION

Dysk is a high-performance command-line tool for analyzing disk usage on Unix-like systems. Written in Rust, it indexes filesystem trees into compact SQLite databases, enabling rapid SQL-like queries without repeated traversal. Unlike du(1), which scans directories each time and consumes high memory on large trees, dysk builds indexes once for instant subsequent queries.

Key features include an interactive dashboard mode for ncdu-like navigation, direct SQL queries for precise stats (e.g., largest files, directory sizes), and low memory footprint. Indexing supports multi-threading and progress bars. Queries use virtual tables with functions like size(), count(), and path filters.

Ideal for servers, large datasets, or frequent usage analysis. Indexes are portable across machines with compatible filesystems (ext4, XFS, Btrfs, etc.). Rebuild indexes after changes. Dashboard offers sorting, deletion, and export.

CAVEATS

Indexes must be rebuilt after filesystem changes; large indexes consume disk space; limited filesystem support (no NFS); dashboard keybindings may differ from ncdu.

QUERY EXAMPLES

dysk "SELECT path, size() FROM /home WHERE size() > 1GB"
dysk "SELECT path, count() FROM /var/log"
Full SQL syntax with GLOB patterns and aggregates.

INDEXING

Run dysk --index-at ~/home.idx /home to create/update index. Use --threads 8 for faster builds on SSDs.

HISTORY

Developed by sharkdp (author of fd, bat, hexyl) starting 2020. First release v0.1.0 in 2021. Actively maintained on GitHub, focusing on speed and Rust ecosystem integration.

SEE ALSO

du(1), ncdu(1), dust(1), gdu(1), sqlite3(1)

Copied to clipboard