
Build a Disk Usage Analyzer in Rust Like du and ncdu
du walks a tree and adds up file sizes. The interesting decisions are hard links counted once, symlinks left alone and how to keep going when a directory is unreadable.
Tag
10 posts

du walks a tree and adds up file sizes. The interesting decisions are hard links counted once, symlinks left alone and how to keep going when a directory is unreadable.

A fuzzy finder reads lines, filters them as you type and prints the one you pick. The pieces are raw mode input, a matching engine and a small redraw loop.

pulldown-cmark turns Markdown into a stream of events, and its HTML writer renders them. A small CLI adds file handling, options and a page template around it.

A jq clone needs three parts: a parser for a small path language, an evaluator over serde_json values and a printer. The core is about 150 lines.

A log analyzer is a streaming pipeline: read lines, parse with a regex, fold into counters and print the top entries. Iterators keep memory flat on gigabyte files.

Build a git hook manager in Rust: read a hooks config, install shims into .git/hooks, run commands on staged files in order, and report results with proper exit codes.

Build a todo list CLI in Rust with clap subcommands, serde JSON storage, stable ids, atomic and durable saves, and a file lock that stops concurrent runs from losing items. Every claim measured.

Build a Markdown link checker in Rust: extract links with pulldown-cmark, check them concurrently with reqwest and a semaphore, retry, report and set exit codes.

Build a fast file finder in Rust: parallel directory walking with the ignore crate, glob and regex filters, size and type predicates, and sorted deterministic output.

Build a grep clone in Rust from a naive version that panics on Latin-1 text to a streaming one that searches 72 MB in 77 ms with 2.5 MB of memory, handling binary files, exit codes and broken pipes.