dirsizes is a lightweight, blazing-fast command-line tool for Windows/Linux/macOS that scans a directory and reports:
- The total size of all files inside
- The largest immediate subdirectories (recursively summed)
- Human-readable output (KB/MB/GB/TB)
- Extremely fast filesystem traversal using
walkdir. It's Rust.
Perfect for finding where your disk space is disappearing.
- Recursive directory size calculation
- Sorts directories by size (descending)
- Cross-platform
- Zero dependencies except
walkdir - Human-readable size formatting
- Fast enough to scan hundreds of thousands of files
Download from releases or:
Clone the repository:
git clone https://github.com/youImTheLeviDRrname/scanFiles
cd scanFilesBuild in release mode:
cargo build --releaseThe compiled binary will be located at:
target/release/dirsizes
dirsizesdirsizes "C:\Users\Username"dirsizes "C:\Users\Username" 50Where:
- first argument = path to scan (default:
".") - second argument = how many largest subfolders to display (default:
30)
Scanned: C:\Users\Username
Total: 102.44 GB (0.10 TB)
Top 10:
1. 32.10 GB AppData
2. 25.77 GB Downloads
3. 12.43 GB Videos
4. 8.51 GB Pictures
5. 6.17 GB Documents
6. 5.22 GB NeverGonnaGiveYouUp1hour.mp4
7. 4.23 GB . (files in root directory)
Requirements:
- Rust 1.60+
- Cargo installed
Then:
cargo build --releaseYou can optionally copy the binary into your PATH:
cp target/release/dirsizes /usr/local/bin/or Windows:
copy .\target\release\dirsizes.exe C:\Windows\System32\main.rs– CLI code + scanning logic- Uses
walkdirfor fast recursive traversal - Human-readable unit formatting
- HashMap aggregating first-level subdirectory sizes
MIT License. Feel free to modify, distribute, and use it in any project