Batch rename in Linux with GPRename - gHacks Tech News

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

Figure 1

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:

  1. Select the files you want to rename.
  2. Click on the Insert/Delete tab.
  3. Select Insert.
  4. Decide where you want to insert the first character of the date (remember position 0 is the first character).
  5. Figure 2

    Enter the data string you want to add in the text field.

  6. Click Preview to view the changes (see Figure 2).
  7. 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:

  1. Select all the files you need to make changes to.
  2. Click on the Numerical tab.
  3. Select the number you want to start with.
  4. Set how you want the numbers to be incremented by.
  5. If you want a character between the number and the file name (such as "_") add it to the "and after" section (see Figure 3).
  6. Figue 3

    Make sure Keep Existing Names (either Before or After) is checked.

  7. Click Preview to see the changes.
  8. 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).

Summary
software image
Author Rating
1star1star1star1star1star
no rating based on 0 votes
Software Name
GPRename
Operating System
Linux
Software Category
Productivity
Landing Page

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. cg0191 said on August 21, 2010 at 1:39 am
    Reply

    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?

  2. lefty.crupps said on August 21, 2010 at 4:56 pm
    Reply

    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!

  3. Won said on August 26, 2010 at 12:18 pm
    Reply

    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.

  4. Scott Fortney said on June 24, 2011 at 5:27 pm
    Reply

    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.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.