Rust target/ folders are eating my disk

A single Rust project's target/ folder can reach tens of gigabytes. All of it is rebuildable.

Find them

 Terminal
find ~ -name Cargo.toml -not -path '*/.cargo/*' 2>/dev/null | while read f; do d="$(dirname "$f")/target"; [ -d "$d" ] && du -sh "$d"; done | sort -h

Clean one project

 Terminal
cd path/to/project && cargo clean

The shared download cache

~/.cargo/registry holds downloaded crates. See Cargo registry.

Let the raccoon do it, safely

Junk Raccoon finds this clutter for you, shows every file first, and keeps a one-click way back. Free beta for Mac.

Download for Mac