Mass Rename is a powerful BASH script designed to help you efficiently rename and organize groups of files. It's especially useful for managing media files, making them easier to import into media servers like Jellyfin, Plex, and Emby by following naming conventions that allow for easier metadata collection.
- Bulk Rename: Rename groups of files using custom patterns.
- Move Files: Easily move renamed files to specified directories.
- Media Server Compatibility: Simplifies media file organization for media servers.
- Testing Options: Supports testing to ensure accurate renaming before applying changes.
- Efficient File Organization: Rename large sets of files such as photos (e.g., from
56894315.jpg
toVacation2024-01.jpg
) with ease. - Metadata Automation: Following proper naming conventions makes it easier for media servers like Plex, Emby, and Jellyfin to automatically collect metadata, such as TV show and movie information, as well as movie posters.
- To test the script or contribute to the project, refer to the Testing Instructions
- A Python version of the script is also available. To switch to it, check out the python branch.
- For alternative methods to rename and organize files, see the Alternatives page.
Follow these steps to install and prepare the script:
- Clone the repository:
git clone https://github.com/2bitninja/mass_rename.git
- Navigate to the directory:
cd mass_rename
- Make the script executable
chmod +x mass_rename.sh
To perform a test run with the script:
Start the renaming process by running the following command:
./mass_rename.sh
The script will prompt you to input the path of the files you want to rename:
This script renames a group of files. Please use with care.
Where are the files located?:
Type test-dir
, (or another directory), and the script will display the files in that directory, for example:
These are the files located : test-dir
[fan] name of file (date).720p.mhsie.mkv
[fan] name of file (date)E01S01.720p.mhsie.mkv
[lovesubs].anime_name.E01S01.[1080p].epname.stuff.mkv
...
WordGirl - 1x01 - Tobey or Consequences High Fat Robbery.mp4
WordGirl - 1x02 - You Cant Crush City Hall Two Brain Highway.mp4
...
Please input what you want to change:
At the prompt, type the part of the filenames you want to change. For example:
WordGirl - 1x
Tip
You can also cut and paste the text directly from the file list.
Please input what you want to changed: WordGirl - 1x
WordGirl - 1x01 - Tobey or Consequences High Fat Robbery.mp4
WordGirl - 1x02 - You Cant Crush City Hall Two Brain Highway.mp4
WordGirl - 1x03 - Coupon Madness When Life Gives You Potatoes.mp4
...
Please input what you want to add:
Next, the script will ask for the new text to add. For instance, to rename with the season and episode format, type:
S01E
The files will be renamed accordingly:
Please input what you want to add: S01E
The files have been renamed to:
S01E01 - Tobey or Consequences High Fat Robbery.mp4
S01E02 - You Cant Crush City Hall Two Brain Highway.mp4
S01E03 - Coupon Madness When Life Gives You Potatoes.mp4
...
Notice that WordGirl - 1x
has been replaced with S01E
in the filenames.
Tip
If you leave the input blank, the script will simply remove the specified text (e.g., WordGirl - 1x
) without replacing it, effectively deleting that part of the filename.
Note
Currently, the script cannot handle special characters like [ ]
. This limitation will be addressed in a future update.
Feel free to provide feedback, suggest improvements, or report any issues!