Skip to content
TranDenyDFWPublic

About

Fast, safe CLI disk-usage analyzer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

dnest — fast, safe CLI disk-usage analyzer

A command-line TreeSize/dust-style disk-usage tool in Rust for Windows. It reports file and folder sizes, finds the largest nested folders ("nests"), optionally finds duplicate files, and exports to JSON / CSV / an interactive HTML treemap — using only unprivileged filesystem reads: no administrator rights, no kernel driver, read-only (it never deletes or modifies anything).

  • Fast — parallel walk over rayon's work-stealing pool; on Windows each entry's size/attributes come from the directory buffer (no per-file stat). ~8,700 folders/sec measured (11 GB / 1,741 folders in 0.2 s).
  • Minimal — a single ~0.7 MB stripped .exe, no runtime to install.
  • Safe — no admin; skips reparse points (junctions/symlinks) so it never loops or double-counts; access-denied paths are reported, not silently dropped.
  • Sees the largest nests — a size-sorted terminal tree with proportional bars, top-N folder/file lists, and a click-to-drill treemap.

Build

Requires the Rust toolchain (installs with no Visual Studio — the whole dependency set is pure Rust, so rustup's GNU toolchain suffices):

winget install --id Rustlang.Rustup -e
rustup toolchain install stable-x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnu

cargo build --release        # -> target/release/dnest.exe  (~0.7 MB)
cargo test

Usage

dnest <path> [options]

  --depth <N>        directory levels to print (default 3; the scan is always full)
  --top              also list the largest folders & files
  -n, --limit <N>    how many to list for --top (default 20)
  --size-on-disk     also compute allocated size on disk (slower; 1 extra call/file)
  --dupes            find duplicate files (size -> xxh3 -> blake3)
  --min-size <SIZE>  hide tree entries smaller than SIZE (e.g. 10M)
  --json --csv --html   write reports in those formats (any combination)
  -o, --out <path>   output file (one format) or directory (multiple)
  --threads <N>      worker threads (default: CPU cores)
  --no-progress      suppress the scanning spinner
  -h, --help / --version

Examples

dnest C:\Users\me                       # size tree of the folder
dnest D:\ --top --depth 4               # tree + largest folders/files
dnest C:\proj --html -o proj.html       # interactive treemap you open in a browser
dnest E:\media --dupes                  # find duplicate files + reclaimable space
dnest C:\data --json --csv --html -o report   # all three into a report\ folder

The largest-nests views

  • Terminal — every folder's children are sorted largest-first with a proportional bar, so the heaviest branch is always on top; --top adds flat "largest folders" and "largest files" lists.
  • HTML treemap — one self-contained .html (no internet needed): rectangle area = size, so the biggest nests are the biggest boxes. Click a box to drill into that nest, breadcrumb back out, hover for size and percentages. Light and dark themes both supported.
  • CSV — one row per directory (path,depth,size_bytes,size_on_disk,file_count,dir_count, pct_of_parent,pct_of_root); sort by size_bytes in Excel and you have the ranking.
  • JSON — nested {name,path,size,own,files,dirs,children}; query with jq.

How it works

One parallel walk builds a single directory tree with sizes aggregated bottom-up; every output is a thin serializer of that tree. Duplicate detection (opt-in) mirrors Czkawka's pipeline — group by exact size, then an xxh3 prehash of the first/last 4 KiB, then a full blake3 hash of the survivors — so the expensive hash touches only genuine candidates.

Notes & limits

  • Windows-only (uses Windows file attributes and GetCompressedFileSizeW).
  • size = logical bytes by default; pass --size-on-disk for allocated size (compression/sparse aware), which costs one extra call per file.
  • Long paths (\\?\) and UNC roots (\\server\share) are handled.
  • Memory is bounded by directory count (one node per folder) plus a bounded top-K file list; --dupes additionally holds one (size, path) record per file while hashing.
  • The tool is read-only — it reports; it never deletes. Use its output to decide what to remove.

License

dnest is released under the MIT License (see LICENSE).

It links only permissively-licensed Rust crates (MIT / Apache-2.0 / BSD-2-Clause / BSL-1.0 / CC0-1.0 / MIT-0 / Unicode-3.0 / Unlicense — no copyleft). Full per-crate attribution and the verbatim text of every dependency license are in THIRD-PARTY-LICENSES.md, harvested from the crates' own license files.

About

Fast, safe CLI disk-usage analyzer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors