2bitninja / mass_rename

This BASH script is for mass renaming and moving of files. This can be helpful if you have a lot of media that need to imported in applications such as Jellyfin
GNU General Public License v3.0
2 stars 0 forks source link
bash bash-script bash-scripts jellyfin mv plex plex-media-server rename rename-files rename-script renamer renamer-utility renames renaming-files

Mass Rename

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.

Features

Why Use Mass Rename?

Additional Information

Installation

Follow these steps to install and prepare the script:

  1. Clone the repository:
    git clone https://github.com/2bitninja/mass_rename.git
  2. Navigate to the directory:
    cd mass_rename
  3. Make the script executable

    chmod +x mass_rename.sh

    Usage Example

    To perform a test run with the script:

    1. Exacute the mass_rename.sh Script

    Start the renaming process by running the following command:

    ./mass_rename.sh

    2. Specify the Location of Files

    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: 
### 3. Remove or Modify Part of the Filename
At the prompt, type the part of the filenames you want to change. For example:
```bash
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: 

4. Add or Change Text in the Filename

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!