# cleanux

Fast, safe, and scriptable Linux cleanup in one Rust CLI.
Think "CleanMyMac for Linux" without the bloat:
- Scan and safely clean user cache (Trash by default)
- Clean common browser caches (Chromium/Firefox)
- Clean thumbnails and recent files list
- Optional user log cleanup (systemd journal)
- Find duplicate files (size -> BLAKE3 hash)
- List the largest files fast
## Requirements
- Rust 1.85+ (Rust 2024 edition)
## Build
```bash
cargo build --release
```
## Testing
- The confirmation dialog test auto-skips when stdin is a TTY to avoid blocking.
## Usage
### Scan (all cleaners)
```bash
./target/release/cleanux scan
```
### Clean (safe: move to Trash)
Dry-run is the default. Add `--apply` to actually move items to Trash.
```bash
./target/release/cleanux clean # dry-run
./target/release/cleanux --apply clean # apply
```
### Restrict to cache-only cleaners
```bash
./target/release/cleanux scan cache
```
### Find duplicates
```bash
./target/release/cleanux dups ~/Downloads
./target/release/cleanux dups ~/Downloads --trash --min-bytes 1048576
```
### Largest files
```bash
./target/release/cleanux large ~ --top 30 --min-bytes 10485760
```
### JSON report output
```bash
./target/release/cleanux --report json scan
```
## Notes / Safety
- `cleanux scan` targets multiple cleaners; use `scan cache` to restrict to cache items.
- Deletions are implemented as **move to Trash** (FreeDesktop Trash on Linux).
- You can extend cleaners by adding modules under `src/cleaners/`.
## Why cleanux?
- **Safe by default**: dry-run first, Trash instead of delete.
- **Fast scans**: parallel walking with predictable output.
- **Simple workflow**: one binary, clear subcommands, no daemon.
## Roadmap ideas
- Configurable excludes via `config.toml`.
- More cleaners (system logs, old downloads, browser caches).