A symlink is broken when its target no longer exists. unrot finds these, reports the dead target path, and attempts to
locate where it moved by fuzzy matching the target filename against the real filesystem. You decide whether to re-link, skip, or remove.
cargo install unrot
# Scans current directory for broken symlinks and interactively allows you to fix them (default)
unrot
# Scans a specific directory
unrot /path/to/project
# Scan only — report broken links (link -> target)
unrot scan /path/to/project
# List broken symlink paths only, no candidates
unrot list /path/to/project
# Search for candidates in a wider directory tree
unrot ~/project -s ~/
# Preview what would happen without modifying anything
unrot /path/to/project --dry-run
# Add extra directories to skip (on top of .git, node_modules, target, etc.)
unrot /path/to/project -I vendor -I dist| Command | Description |
|---|---|
| (default) | Interactive fix mode — scan, show candidates, let you re-link/skip/remove |
scan [PATH] |
Scan only, report broken links (link -> target) |
fix [PATH] |
Interactive fix mode (explicit) |
list [PATH] |
List broken link paths only, no candidates, exit |
When prompted for each broken symlink:
| Input | Action |
|---|---|
1, 2, ... |
Re-link to the numbered candidate |
c |
Enter a custom path to re-link to |
s |
Skip this symlink |
r |
Remove this symlink (asks for confirmation) |
| Option | Short | Description |
|---|---|---|
[PATH] |
— | Directory to scan (default: .) |
--search-root <PATH> |
-s |
Search for candidates here instead of the scan path |
--dry-run |
— | Preview changes without modifying the filesystem |
--batch-confirm |
— | Collect all decisions, show summary, then confirm before applying |
--ignore <NAME> |
-I |
Additional directory names to skip (repeatable) |
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.