Disk Usage Analyzer

Sebastian Thiel·Byron.dua-cli

View disk space usage and delete unwanted data, fast.

dua (→ Disk Usage Analyzer) is a tool to conveniently learn about the usage of disk space of a given directory. It's parallel by default and will max out your SSD, providing relevant information as fast as possible. Optionally delete superfluous data, and do so more quickly than rm.

winget install --id Byron.dua-cli --exact --source winget

Latest 2.44.0·August 30, 2026

Release Notes

This is a massive release that cost my weekend and was motivated by the chance to reduce the amount of open issues to 0. Besides the memory usage being cut in half, one can now keep snapshots of interactive runs, and compare them to older snapshots, or simply view them again with different settings. Finally, it's now possible to configure keyboarding as well. What follows is the more elaborate, generated version of this text, and not my speech. This release turns traversal results into durable artifacts, shows exactly where disk usage moved, puts every interactive key under user control, and makes large traversals substantially leaner. dua interactive --export before.dua

... later ...

dua interactive --export after.dua dua diff before.dua after.dua Snapshots. Completed interactive traversals can now be exported atomically to a deterministic, SHA-256-protected snapshot, with streaming zlib compression by default. Load one with dua interactive --import for a read-only tour, or replay it through dua aggregate --import as a flat list, a depth-limited tree, or folded stacks, with the usual sorting and total controls. Snapshot imports retain root order and traversal metadata; the aggregate renderers replay them with bounded memory. The interactive view still supports navigation, searching, sorting, marking, and opening stored paths that continue to exist, while refresh, trash, and deletion stay safely disabled. Its mark pane drops destructive prompts and colors for snapshots, or whenever both destructive actions are unbound. The dua crate exposes the snapshot, replay, and diff APIs for library users as well. Diffing. dua diff OLD NEW streams additions, removals, and signed size changes as a compact, colored context tree, then shows the largest additions and removals. Use --directories-only, --prefix, --depth, --format, and --summary-limit to shape the report. Both snapshots are checksum-verified in parallel before their canonical entry streams are merged in bounded memory; whole added or removed directories collapse into a single useful change. Configurable keybindings. Every interactive action can now be rebound or disabled, and dua config show-default documents all bindings. Pane hints follow the configured keys, while --once understands the same named and modified bindings as well as compact character sequences. Lower memory use. Traversal state now uses a compact arena-backed tree, shared filename storage, and dense directory IDs; snapshot replay borrows names and reuses decoding buffers. In a local ~/dev scan, /usr/bin/time -lp measured maximum RSS at 268,206,080 bytes versus 524,812,288 bytes for 2.43.1—a 49% reduction. More interactive polish. Shift+U can extend a completed scan into its parent, the mark pane shows the selected percentage of the root, and Ctrl+Z now suspends and cleanly resumes the TUI on Unix. New Features

  • accept configured keys in --once Keyboard shortcuts are configurable, but --once could only synthesize plain character events. That made named and modified bindings impossible to reproduce in one-shot debugging runs.
    • Reuse the configuration keybinding parser for --once.
    • Convert parsed bindings into terminal events.
    • Preserve compact character sequences such as --once=jko.
  • add streaming snapshot diff command KOMAC_HEADER Command-line interface
    • Add dua diff OLD NEW to compare an earlier traversal snapshot with a later one.
    • Support byte-format selection either globally or after the subcommand, with the configured format as the fallback.
    • Add --directories-only for aggregate directory changes, --prefix PATH for a component-aware subtree filter, --depth DEPTH for limiting the displayed tree, and --summary-limit COUNT for sizing or hiding the largest additions and removals lists.
    • Treat the selected root or prefix as the first displayed depth level while leaving summary calculations unbounded.
    • Reject traversal-only options and input paths because diffing never walks the live filesystem.
    • Hash both decompressed snapshots in parallel before comparison, then validate their records as they stream and verify each digest again at the end. KOMAC_HEADER Streaming comparison
    • Refactor snapshot decoding into a resumable decoder and entry iterator that can replay a verified, seekable snapshot without materializing its tree.
    • Rewind each snapshot for every pass and verify its digest again at the end of replay, detecting files changed after initial validation.
    • Expose native encoded names and duplicate-sibling ordinals from decoded entries to build deterministic comparison keys on Unix and Windows.
    • Enforce canonical sibling ordering during decoding and distinguish repeated sibling names without changing the snapshot format.
    • Merge the two canonical depth-first streams in lock-step on the main thread while a background collector retains only bounded summary entries.
    • Pair roots in stored order and deliberately avoid cross-root matching or rename detection.
    • Collapse an entirely added or removed directory to one change and skip its descendants, keeping large subtree changes concise. KOMAC_HEADER Diff output
    • Report additions, removals, and signed size deltas with +, -, and ~ markers in a compact tree with shared directory context.
    • Stream the tree first, then report a configurable number of the largest additions and removals (five by default) and the total number of changes.
    • Compare file sizes in the default mode and aggregate directory sizes in directory-only mode, including file-to-directory type changes.
    • Preserve full u128 size deltas and use the selected human-readable byte format.
    • Mark depth-collapsed branches with an ellipsis without hiding their entries from the largest-change summary.
    • Render terminal additions in green, removals in red, modifications in yellow, and directory context in cyan while keeping redirected output free of escape sequences.
    • Use native path separators, sanitize control characters that could split output lines, and emit no output for identical snapshots or unmatched prefixes.
  • add traversal snapshot codec KOMAC_HEADER Snapshot format
    • Add a deterministic version-1 DUASNAP\0 codec for depth-first traversal forests while preserving input-root order and native Unix and Windows path representations.
    • Encode parent distances, node flags, names, u128 sizes, nanosecond modification times, and optional entry counts using canonical ULEB128 fields.
    • Validate path components, tree structure, record limits, integer encodings, timestamps, node counts, checksums, truncation, and trailing data.
    • Protect decoded snapshot data with SHA-256 and preserve deterministic child ordering.
    • Support raw snapshots and streaming zlib compression through the existing gix::zlib dependency. Export at level 2 by default, accept levels 1–9, and use level 0 for raw output.
    • Verify seekable snapshots once and rewind them for bounded-memory replay without materializing the full tree. KOMAC_HEADER CLI integration
    • Add dua interactive --export to atomically persist a completed traversal through a neighboring temporary file before replacing the destination.
    • Add dua interactive --import to load a snapshot into the terminal UI without traversing the filesystem.
    • Add dua aggregate --import with flat, tree, depth-limited, sorted, total, and folded-stack output modes.
    • Reject traversal-only paths and options when importing and print snapshot provenance to standard error.
    • Preserve stored root ordering, sizes, entry counts, modification times, and metadata IO errors. KOMAC_HEADER Replay rendering
    • Add completed-traversal and replay renderers for aggregate, tree, and folded-stack output.
    • Keep only roots, displayed levels, or the current stack path in memory as required by each output mode.
    • Use checked arithmetic for aggregate and exclusive-size calculations and report malformed snapshot totals instead of silently saturating.
    • Handle the full u128 snapshot size range and sanitize control characters when writing terminal output. KOMAC_HEADER Interactive safety
    • Treat imported snapshots as read-only while retaining navigation, sorting, searching, marking, and display controls.
    • Disable entry existence checks, filesystem refreshes, upward scans, gitignore discovery, permanent deletion, and trash operations.
    • Show the actual snapshot load time until the first user event and replace destructive mark prompts and styling with an explicit read-only safety notice.
    • Allow opening a stored path when it still exists, without weakening the final read-only guards around trash and permanent deletion.
    • Expose completed traversal roots in original input order for deterministic export.
  • make interactive keybindings configurable Interactive shortcuts were hard-coded, preventing users from avoiding terminal conflicts or adapting the controls to their habits. Add per-action [keys] arrays whose defaults preserve the existing controls, route every interactive pane and visible shortcut hint through those settings, and expose all bindings as commented config show-default templates. Parse common named keys and modifiers while handling shifted character events consistently across terminal backends. Regression coverage verifies that overrides replace only their own defaults, the documented template round-trips to the built-in defaults, modified shortcuts remain distinct, and shifted punctuation works on Windows.
  • traverse beyond the interactive root Interactive mode stopped at its initial root and required a restart to inspect its parent. Handle Shift+U by scanning the parent while pruning already represented paths,

Installer type: zip

x86—DCEFA15DB79C5A49FCC854C216E312244B078D4BB1309B804BB7F8A0A816818F
x64—C4AEFB8BC855CFEC58234B7BB75709C3DE3C40F77B100CCB4B81A38EF7AE37AC
arm64—DA74BA924F7739E7F39B6994C1BACA701F9C3810C1200683894B381CF9A9F396

Details

Homepage
https://github.com/Byron/dua-cli
License
MIT
Publisher
Sebastian Thiel
Support
https://github.com/Byron/dua-cli/issues
Copyright
© Sebastian Thiel
Moniker
dua

Tags

cleanerdisk-usage-analyserdisk-usage-analyzerdiskusageanalyserdiskusageanalyzerduacliharddiskharddriverequirescmdspace-usessd

Older versions (23)

2.43.1
x86—593D6F9960283AC7FE8C8AD012C181FB681921A02421412828571F795B62F416
x64—A1FE9FAE3698C54C2F6F92628BECBB3BDC877F7BD0C4EB08A45D9C0E8925CB60
arm64—EAB157F2D8F9A649959340FCEFD1808351D72F2D248C83375F665A3300333895
2.43.0
x86—42EA1768F03F834FC1A952EACEDCAF1EB0005274FAC4D03FAA066D2A8C7AD3AF
x64—E5076331A387BDE610735EF4C352350FF1811B75FA37F4920A84B9199FB369D4
arm64—8B32F98DD4D3E034AC9C7CF206949147FE4580CD0A5E4476393ACC01FBA39EF9
2.42.1
x86—0E6CEC5D1F0B3310FF69F709CC2F15B4297EA8B17460092C325E82C128C2CD9A
x64—6E81D82DEE23E45FB7E93B61C94AD827E5805CD4E6169882298EAB4D07B0330D
arm64—DE051D2AF06E8AF21BD906CC3CB085E9A70747F91EBF4E41B46F7104D5465DDC
2.41.1
x64—04E3413B800DB2AA0924950E4B79CE40C06A61556C43EEF67B362398AE3D67B5
2.41.0
x64—81B9B93258DCBEF0D043B5BA8C048B33D664AC8846DA85606E3BF9C6625AF907
2.40.1
x64—A32C5EA4979AD5CFE134639BA9B4C13B653CE62A820B9F299F41B7578619155C
2.40.0
x64—74D9ADE19E02C09881E486A0FC90E917419FF710C041F0E6BEB3EE84C798E70B
2.39.1
x64—6C0F7FD6AECFDC15462D816D3BD5054B67C83CD95FC5C6C214F78651B470A114
2.39.0
x64—020FBE4D9E9636453820032B7FB7AF80582AE02B8E67695FB200EAC51706F990
2.38.1
x64—1496059BA245743504A8C3E22BBB29C10278E1F4454A10ADAE59042630BEA4FA
2.38.0
x64—C627401B5644A2D0179714FC22946ED6E2F646ED528CA36BB3F6B790C3C8529C
2.37.1
x64—943B26F91446549B2ECD418086BCA31C54E0EBB6F3682DD70F91EF42BC2E020C
2.37.0
x64—E66A99E6139B076F8DA4EF269CE5452EF6636DFBA66D4495F08AE18AD2C369C3
2.36.0
x64—01BF5A17FC9EC0C569EB66540F4C88FDE0CAB868F1F608D9965FD5C65FCC625A
2.35.0
x64—298FED37A89C5FFF7EB6A9FDDD32A7910A3E87C8EBA5BD6D7AD3CBC3310FF4C5
2.34.0
x64—ABBD93E4D8EAF4D1B9181310A0240E37FC3D3E107A70870289125C0171FEFCA9
2.33.0
x86—5709EB0B95AFF758A535BA485B00890DB5824ED7E90232127DC4C68485FD8E1F
x64—24CAF507E3B07B4E8A69C6182D7585129A1020AEAA76545FD5DE536978B22AC3
2.32.2
x86—80F42C40B8F5B3F3BE83A77C456F50FEF89F29B6B8131E4E6E26B1278B399DEC
x64—24DC26E87C09C21926BE2223E2DAA880150B806A05EE4199913ACB9A348E62B4
2.32.1
x86—5E07C495D6971DB244C76E0EDE2BB97189CD4835D67C76AF71FCD6C06AE0A0CF
x64—78C58CBDD7BC21BC52413F3990C6076EB80E3C0A9B27A92DEC1FD40E5DFDA78D
2.32.0
x86—AE7AC78E6CC44AC39AA49F1AE7CB90D52D6D56C547F81F88EE5F4F96BF12243E
x64—EB697C75361479C1E645CC4D7BB54BF83D6900E79159D308E5B363C36C0BABE4
2.30.1
x86—2A0B41F387C9516F98675D4C75E43B1DF77EFFC88D11ED9F169CD4AB116A7181
x64—EC2CE2ED27E098E117BDA12E1A1C262477134EA1ED5F96DA20D8BF6CDFC10707
2.30.0
x86—6359CEB2B0EEC50D1C77F8E95A8FBAE8BE27750FB0F9D8EF1308AD1442621080
x64—03926D799703342D644EBE2C4AA7141B5A71CBDBAFE4CC3E36C83DE32AE3644C
2.29.2
x86—4C9523BA0BADF681D1EFBFE85D6AC0D51A664BE08D1560F978B12A270CD713E9
x64—1B07D998F254F4AF2FEA33D0C304831D1AFEAE8C1990318201F45F16707A402C