A command-line utility for batch renaming files with powerful sorting and formatting options.
- Rename multiple files at once using patterns and numbering
- Sort files by name, size, or modification date
- Customizable numbering format with padding
- Preserve file extensions
- Simple and intuitive command-line interface
Just copy this line, paste it into a terminal, press enter, done!
sudo curl -fsSL https://raw.githubusercontent.com/apapamarkou/batch-rename-cli/main/brn -o /usr/bin/brn && sudo chmod +x /usr/bin/brn
- Python 3.x
- Curl
- Linux/Unix-based system
sudo apt update
sudo apt install python3 curl
sudo dnf update
sudo dnf install python3 curl
sudo zypper refresh
sudo zypper install python3 curl
sudo pacman -Syu
sudo pacman -S python curl
sudo yum update
sudo yum install python3 curl
sudo apk update
sudo apk add python3 curl
Basic syntax: brn [files] [options]
- Rename all JPG files with sequential numbers:
brn *.jpg --count 001
- Rename files sorted by size in descending order:
brn *.png --sort-size desc --count 001
- Rename with custom prefix:
brn *.txt --prefix document_ --count 01
- --count : Start numbering from specified value (e.g., 001, 01)
- --prefix : Add prefix to filenames
- --sort-size: Sort files by size
- --sort-date: Sort files by modification date
- --sort-name: Sort files by name (default)
- asc/desc: Specify sorting direction (e.g., --sort-size desc) use brn --help to view more...
Before:
photo1.jpg
photo2.jpg
photo3.jpg
After brn *.jpg --count 001
:
001.jpg
002.jpg
003.jpg
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch ( git checkout -b feature/AmazingFeature)
- Commit your changes ( git commit -m 'Add some AmazingFeature')
- Push to the branch ( git push origin feature/AmazingFeature)
- Open a Pull Request
This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.
Andrianos Papamarkou
- Thanks to all contributors who have helped with the development
- Inspired by the need for efficient batch file renaming in the command line
If you encounter any issues or have questions, please file an issue on the GitHub repository.
- Initial release
- Basic renaming functionality
- Sorting options
- Customizable numbering