2 stable releases
| 1.0.1 | Aug 27, 2025 |
|---|
#1209 in Command line utilities
62 downloads per month
10KB
114 lines
dinfo
A fast and colorful Rust command-line tool for disk usage analysis. dinfo provides comprehensive directory analysis with beautiful colored output, showing total size, top files, and top folders.
✨ Features
- 📊 Total directory size calculation with human-readable format
- 📁 Top 5 largest folders analysis
- 📄 Top 5 largest files identification
- 🎨 Colorized output for better readability
- ⚡ Fast recursive scanning using efficient algorithms
- 🔧 Zero configuration - works out of the box
📦 Installation
From crates.io (Recommended)
cargo install dinfo
From source
# Clone the repository
git clone https://github.com/Sdqumar/dinfo.git
cd dinfo
# Install locally
cargo install --path .
Build from source
# Clone and build
git clone https://github.com/Sdqumar/dinfo.git
cd dinfo
cargo build --release
# The binary will be available at target/release/dinfo
🚀 Usage
Simply run dinfo in any directory to analyze its disk usage:
dinfo
📋 Output Example
=== Summary ===
Total size : 245.67 MB
== Top 5 Files ==
1. 25.4 MB ./target/release/dinfo
2. 12.8 MB ./assets/large_dataset.json
3. 8.9 MB ./docs/manual.pdf
4. 5.2 MB ./src/data/sample.csv
5. 3.1 MB ./README.md
== Top 5 Folders ==
1. 156.2 MB ./target
2. 45.7 MB ./assets
3. 23.1 MB ./docs
4. 12.4 MB ./src
5. 8.3 MB ./.git
🎯 Use Cases
- Clean up disk space: Quickly identify the largest files and folders consuming disk space
- Project analysis: Understand the size distribution of your codebase or project
- System monitoring: Regular disk usage monitoring and cleanup
- Development workflow: Identify bloated build artifacts or large dependencies
🛠️ Technical Details
- Language: Rust 🦀
- Dependencies:
walkdirfor efficient directory traversalcoloredfor terminal color output
- Performance: Optimized with heap-based algorithms for top-N selection
- Compatibility: Cross-platform (Linux, macOS, Windows)
🔧 Configuration
dinfo works with zero configuration. It analyzes the current working directory and displays results immediately.
📖 Algorithm
- Recursive Scanning: Uses
walkdirto efficiently traverse the directory tree - Size Calculation: Accumulates file sizes and propagates to parent directories
- Top-N Selection: Uses binary heaps for efficient identification of largest items
- Human-Readable Formatting: Converts bytes to appropriate units (B, KB, MB, GB, TB, PB)
🤝 Contributing
Contributions are welcome! Please feel free to:
- 🐛 Report bugs
- 💡 Suggest new features
- 🔧 Submit pull requests
- 📖 Improve documentation
📜 License
This project is dual-licensed under:
- MIT License
- Apache License 2.0
Choose the license that best fits your needs.
🔗 Links
Made with ❤️ in Rust
Dependencies
~0.2–2MB
~38K SLoC