dfr

Crates.iodfr
lib.rsdfr
version1.2.0
created_at2025-05-26 03:46:16.615291+00
updated_at2025-05-26 04:25:33.552229+00
descriptionA minimalist `df clone written in Rust - displays mounted filesystems & disk usage
homepage
repositoryhttps://github.com/codemonkey76/df-rust
max_upload_size
id1688910
size20,067
Shane Poppleton (codemonkey76)

documentation

README

df-rust

A minimalist df clone written in Rust — displays mounted filesystems, disk usage, and colored usage bars in a clean column layout.

screenshot

Features

  • Parses /proc/mounts directly — no shelling out or external binaries
  • Uses libc::statvfs for disk statistics (no extra crates)
  • Filters out pseudo-filesystems (proc, tmpfs, sysfs, etc.)
  • Displays:
    • Filesystem device
    • Total, used, available space
    • Usage percentage
    • Colored bar graph (■) indicating usage level
  • ANSI color output with clear thresholds:
    • Green: < 75%
    • Yellow: 75–85%
    • Red: > 85%

Output Example

Filesystem         Type     Size   Used  Avail   Use% Graph             Mounted on
/dev/nvme0n1p2     btrfs  930.5G  85.6G 845.0G    9.2% ■■                /
/dev/nvme0n1p1     vfat     1.0G   0.2G   0.8G   22.1% ■■■■              /boot

Building

Make sure you have Rust installed. Then:

git clone https://github.com/codemonkey76/df-rust.git
cd df-rust
cargo build --release

Usage

Run:


./target/release/df-rust

Or install to your path:

cargo install --path .
Commit count: 9

cargo fmt