A CLI tool written in Rust that organizes files into categorized subdirectories by file extension.
- Organizes files into:
Images,Documents,Audio,Video,Code,Archives,Other --dry-runmode to preview changes without moving files--recursiveflag to scan subdirectories--verboseflag for detailed output--undoflag to reverse last operation- Conflict resolution — duplicate filenames are renamed automatically
- Colored terminal output
git clone https://github.com/CMON1975/file_organizer.git
cd file_organizer
cargo build --releaseBinary will be at target/release/file_organizer.
# Organize a directory
file_organizer /path/to/folder
# Preview without moving files
file_organizer /path/to/folder --dry-run
# Verbose output
file_organizer /path/to/folder --verbose
# Recursive scan
file_organizer /path/to/folder --recursive
# Undo last organize operation
file_organizer --undoThe last operation is logged to ~/.local/share/file_organizer/history.log. Only the most recent run can be undone.
| Category | Extensions |
|---|---|
| Images | jpg, jpeg, png, gif, bmp, webp, svg |
| Documents | pdf, doc, docx, txt, md, csv, xlsx |
| Audio | mp3, wav, flac, ogg, aac |
| Video | mp4, mov, avi, mkv, webm |
| Code | rs, py, js, ts, html, css, c, cpp, h |
| Archives | zip, tar, gz, rar, 7z |
| Other | anything unrecognized |
A custom config file can be placed at ~/.config/file_organizer/config.toml to define your own categories and extensions:
[categories]
Images = ["jpg", "jpeg", "png"]
Documents = ["pdf", "txt", "md"]
Ebooks = ["epub", "mobi", "azw3"]Or specify a config file directly:
file_organizer /path/to/folder --config /path/to/config.tomlIf no config is found, built-in defaults are used.
MIT