Batch rename in Linux with GPRename
Do you create or manage a LOT of files? Do you have image files taken from cameras that are all named IMG_XXX.JPG Â (where XXX is a sequential number)? Do you stores of files you wish to change the names to reflect a date, a department, etc? If so, have you scoured the network trying to locate something, anything, that will help you do massive renames quickly...and you don't want to have to write a bash script to do so? Well, halt your search...the tool you need is GPRename.
GPRename is batch renamer for both files and directories that is released under the GPL v3. It's easy to install, and even easier to use. In fact, GPRename is so easy to use you will find the task of batch renaming (one that used to be a real pain) one of the easiest tasks you have. In this article I am going to show you how to install and use GPRename so you can start batch renaming all of those files and folders just waiting for a name change.
Features
The feature list of GPRename isn't the most lengthy of lists, but what more do you need from a batch renamer than:
- Rename files and folders
- Case change
- Inserte/delete
- Replace/remove
- Numerical addition
- Preview
- Built in log
That's pretty much the gist of the features. Let's get on with the installation.
Installation
As you would expect, the installation of GPRename is simple:
- Open up your Add/Remove Software utility.
- Search for "gprename" (no quotes).
- Mark GPRename for installation.
- Click Apply to install.
That's it. When the installation is complete, close the Add/Remove Software tool and get ready to rename.
Usage
To start the tool in GNOME click Applications > Accessories > GPRename. To start the tool in KDE click Start > Applications > Utilities > GPRename. Which will open up the main window (See Figure 1).
As you can see I have GPRename opened to the ~/Pictures directory which is displaying only three images (it's a new account). With these three images I can demonstrate how this tool works. It's actually quite simple. let's say  you want to add the date to all of the file names in the directory. To do this follow these steps:
- Select the files you want to rename.
- Click on the Insert/Delete tab.
- Select Insert.
- Decide where you want to insert the first character of the date (remember position 0 is the first character).
-
Enter the data string you want to add in the text field.
- Click Preview to view the changes (see Figure 2).
- If the preview suits you, click the Rename button to make the changes.
Now let's say you simply want to number the files in a directory. This is just as easy. To do this follow these easy steps:
- Select all the files you need to make changes to.
- Click on the Numerical tab.
- Select the number you want to start with.
- Set how you want the numbers to be incremented by.
- If you want a character between the number and the file name (such as "_") add it to the "and after" section (see Figure 3).
-
Make sure Keep Existing Names (either Before or After) is checked.
- Click Preview to see the changes.
- If the preview suits you, click Rename.
That's all it takes to batch rename files with Linux.
Final thoughts
GPRename is an outstanding tool to use in place of writing shell scripts in order to rename multiple files in Linux. You won't find an easier tool for this task (if you're not already used to whipping up a shell script).
This is indeed a brilliant utility; using it on Linux Mint. Is there a way to access directories of files stored on a networked device, eg. a NAS?
Did you find an answer? I have used this utility for years, now I have a network storage drive connected to the router and I can not access it.
I have been using it to rename files on a NAS.
In my environment from within GPRename I navigate to: /run/user/1000/gvfs/smb-share:server=NASServer.local
I do have the Network Share already connected first.
This tool does not do all that much, if you have a directory with a 1000 subdirectories it just sits there! If I have to go into each subdirectory by hand I might as well do it by hand. Very frustrating! I can’t be the only one out there with the need to recursively go through many subdirectories and rename a bunch of files.
Excellent – i was using Metamorphose’2 for this and had to add their ppa. I will switch to this since it’s within the standard Ubuntu apt.
I use KRename which I really like; it is very powerful but I mostly just use the Find/Replace function within KRename. Dolphin can also bulk-rename files with a numbering sequence by just putting a # in the rename field (img_#.png would sequentially rename the selected files).
I may have to check into this app however, so thanks for the heads up!
Great tool for those of us with lot’s of digital photos on our machines.
Any body have a better tool they know of or is this the best?