A fast and reliable CBR to CBZ conversion tool for GNU/Linux, written in pure bash.
- 🚀 Single bash script
- 🔄 Handles both single files and directories
- 🔍 Recursive directory processing
- ⚡ Parallel processing for maximum performance
- ✅ Preserves file timestamps
- 🛡️ Handles filenames with spaces and special characters
- 📊 Shows progress when processing multiple files
- 🔄 Automatically skips already converted files
- 🗑️ Optional cleanup of original CBR files after conversion
- A GNU/Linux distribution (tested on Ubuntu)
unrar-nonfreefor RAR5+ support andzipfor creating CBZ filesnprocorgetconffor CPU detection (usually pre-installed)sudo apt-get install unrar-nonfree zip
- Clone this repository or download the
cbr2cbz.shscript - Make it executable:
chmod +x cbr2cbz.sh
- (Optional) Move it to your PATH, for example:
sudo mv cbr2cbz.sh /usr/local/bin/cbr2cbz
./cbr2cbz.sh file.cbr./cbr2cbz.sh /path/to/comics./cbr2cbz.sh -r /path/to/comicsUse the -j or --jobs option to specify the number of parallel jobs (defaults to number of CPU cores):
# Use 4 parallel jobs
./cbr2cbz.sh -j 4 /path/to/comics
# Combine with recursive and cleanup
./cbr2cbz.sh -r -c -j 8 /path/to/comics./cbr2cbz.sh --helpTo automatically remove the original CBR files after successful conversion, use the -c or --cleanup flag:
# Convert and remove original CBR files
./cbr2cbz.sh -c file.cbr
# Process a directory and clean up
./cbr2cbz.sh -c /path/to/comics
# Combine with recursive processing
./cbr2cbz.sh -r -c /path/to/comics
⚠️ Note: The cleanup option permanently deletes the original CBR files after successful conversion. Use with caution!
- Scans for CBR files in the specified location (recursively if
-ris used) - Processes files in parallel (up to the number of CPU cores by default, or as specified by
-j) - For each file:
- Creates a temporary directory
- Extracts the CBR (RAR) file contents using
unrar - Creates a new CBZ (ZIP) file with the same name
- Preserves the original file's modification timestamp
- If
--cleanupis specified, removes the original CBR file - Cleans up temporary files
- Shows progress and summary of processed files
- Open Format: CBZ uses the standard ZIP format, which is open and widely supported
- Better Compatibility: Many comic book readers have better support for CBZ
- Free Software: Avoids dependency on proprietary RAR format
This project is licensed under the MIT License
This repository is based on the original work from oogg06/cbr2cbz.
Contributions are welcome! Please feel free to submit a Pull Request.