Skip to content

ImTheLeviDR/scanFiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📁 dirsizes

A fast Rust tool that shows how much space each subdirectory uses

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.


🚀 Features

  • 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

📦 Installation

Download from releases or:

Clone the repository:

git clone https://github.com/ImTheLeviDR/scanFiles
cd scanFiles

Build in release mode:

cargo build --release

The compiled binary will be located at:

target/release/dirsizes[.exe]

🧪 Usage

Basic usage (scan current directory)

dirsizes

Scan a specific directory

dirsizes ~

Show top N largest subdirectories

dirsizes ~ 50

Where:

  • first argument = path to scan (default: ".")
  • second argument = how many largest subfolders to display (default: 30)

📄 Example Output

Scanned: ~
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)

🛠 Build From Source

Requirements:

  • Rust 1.60+
  • Cargo installed

Then:

cargo build --release

You can optionally copy the binary into your PATH:

cargo install --path . --force

Note: On Windows, the binary will be dirsizes.exe. Avoid copying to system directories; use cargo install instead.


📚 Code Structure

  • main.rs – CLI code + scanning logic
  • Uses walkdir for fast recursive traversal
  • Human-readable unit formatting
  • HashMap aggregating first-level subdirectory sizes

📜 License

MIT License. Feel free to modify, distribute, and use it in any project

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages