Rrename is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the command-line executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install rrename
It will make the rrename command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall rrename uninstalls.
Adding rrename library as a dependency
Run this command in a terminal, in your project's directory:
cargo add rrename
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
rrename = "0.1.2"
The rrename library will be automatically available globally.
Read the rrename library documentation .
Back to the crate overview .
Readme
rrename
A very opinionated command-line tool/library for file mass-renaming using regex
Example
no arguments run
> ls
mock
├── Another Dir & Co
│ ├── Some [ some#bs] .txt
│ └── Some & Track.txt
├── Some Dir
│ ├── SOME_fILe.txt
│ ├── some, text_file.txt
│ └── some,text_file.txt
└── Some - Word With III dCi135_
└── Some Word F3500 dCi135 StereoM10.txt
> rrename
> ls
mock
├── another-dir-and-co
│ ├── some-and-track.txt
│ └── some-[ some#bs] .txt
├── some-dir
│ ├── some-file.txt
│ ├── some-text-file-25057.txt
│ └── some-text-file-57497.txt
└── some-word-with-iii-dci135-
└── some-word-f3500-dci135-stereom10.txt
using regex to substitute
> ls
3pv-some-file.mp4
> rrename -E " 3pv-" - s " "
' ./3pv-some-file.mp4' -> ' ./some-file.mp4'
Renamed: 1, depth:1
kudos
wrench was taken as a base
License: MIT OR Apache-2.0