Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to rename a bunch of files in order to fix their sort order, therefore I need to be able to do a sort of "find and replace" so I can replace chunks of the filenames at a time.

What tools should I use? I prefer GUI but a command line tool recommendation would also be fine.

share|improve this question

13 Answers 13

up vote 49 down vote accepted

There are a few but I recommend gprename Install gprename which is a good compromise between usability and functionality.

Other tools are: rename, krename Install krename , pyrenamer Install pyrenamer , cuteRenamer, ...

share|improve this answer
pyRenamer is not bad at all. – skalka Oct 31 '10 at 19:20
I have use pyrenamer often and sometimes gprename unless the change is very easily done on the command line. The best thing about these GUI's is the built-in 'preview' action. This will save you headaches. – belacqua Jan 21 '11 at 22:22
+1 for gprename, just tried and done the needed rename in 5 seconds – Pisu Nov 8 '13 at 6:28
Shame neither gprename or pyrename can take list of files to rename from the command line – artfulrobot May 17 '14 at 9:48
gprename is great on 14.04. Did 300 folders renaming by regex in 15 seconds – 3rgo Jan 30 '15 at 18:16

I really like qmv from the renameutils package. It enables you to use your favorite (terminal based) text editor to rename files. I prefer to invoke it with -f do which gives you a single column (one row per file) with filenames. Combined with the power of Vim it gives you all the tools you need to do massive filename editing.

share|improve this answer


may be a little difficult to handle, but really powerful!

share|improve this answer
I really like this one. It is quite powerful and runs on all major platforms. – daniels Sep 15 '15 at 17:26

If you like the shell and perl regular expressions I'd recommend rename. It's as plain as it's name.

share|improve this answer might help you. But it uses the command line.

share|improve this answer
Thanks, I really like "rename"... I realize it doesn't suit everyone, but the good thing about the command line (for me) is that it is typically consistant, and more powerful... I tried the mentioned GUIs, but..."Oh no! Not another quirky interface to grapple with!" ,,, and none of them used "standard" Regular-Expressions; this one does.... but if I find a GUI renamer with full-blown regex capability, and can be launched from the file-browser, I'll probably use it (as well as "rename"). – Peter.O Nov 1 '10 at 4:35
@jgbelacqua:.. I've re-arranged the names of more groups of audio/video/pics than I care to think about.. I did much of it in Windows with a literal-text renamer, but if I had a regex renamer at the time it would have saved a lot of "nuisance" time, and any time spent familiarizing one's self with regex is time well spent... I am endlessly amazed at the flexibility of Regular Expressions. (perhaps it is only because of mass renamers that I even bother to rename them...but I do, and regex makes it easier.. :) – Peter.O Jan 24 '11 at 19:37

thunar file manager is a GUI with a bulk rename option

it's not standard on Gnome but can be installed through the software centre

share|improve this answer

If you are familiar with Emacs, I think nothing beats Dired for this task. Even if you don't use Emacs that often you may find Dired a handy tool.

sudo aptitude install emacs23-nox

Start Emacs Dired mode for a directory:

emacs -nw path/to/dir/

Now enter edit directory mode:

C-x C-q (that is Ctrl+x followed by Ctrl+q)

You can now edit the filenames like editing text in every plain text editor. You may even chose to replace the filenames using regular expressions.

When finished, type:

C-c C-c (that is Ctrl+c followed by Ctrl+c)

Or alternatively press the following sequence to abort your changes:

C-c Esc (that is Ctrl+c followed by Esc)

share|improve this answer

I tend to use mmv, which is command-line based, and has a somewhat quirky expression syntax but tend to solve most of my problems.

share|improve this answer

If you use Nautilus and know how Nautilus Scripts work, you could use nautilus-renamer.

share|improve this answer

On the command line theres also the possibility to use magic of sed and shell:

ls *.c | sed "s#\(.*\)\.c#mv \0 \1.cpp#" | sh
share|improve this answer
That doesn't seem to work as printed. You might also use '#' or other character instead of "\" as separators in examples for possibly more clarity. e.g., ` ls .c | sed 's#([a-z])\.c#\1.cpp#' ` (This example is not do the rename, just to display the new filename, for simplicity) – belacqua Jan 21 '11 at 23:07
Thanks, I have incorprated the edits – Mr Shark Jan 24 '11 at 14:29
+1 I find it a really nice way (that additionally works across all distros), without installing anything. But I would probably use the -d switch for ls to avoid listing content of directories which might also end with .c (most of the times not an issue, but still ..). – Levit Nov 3 '14 at 8:42

For me the pyRenamer worked the best. Nothing (sadly) comes close to Total Commanders built it renaming tool. pyRenamer doesn't integrate with Krusader but considering the fact, that you don't use the renaming tools that often anyway, pyRenamer is a very good option.

share|improve this answer

This is the tool I use: rnm (web page)

Some Usage:

rnm file-name -ns new-filename             # signle file
rnm ./* -ns '/n//i/'                       # files will be sorted and indexed.
rnm ./* -rs '/search/new/g'                # 'search' in filenames will be replaced with 'new'
rnm ./* -ns '/fn//i/' -ss 'search'         # only files/directories which contain 'search' in their name will be indexed (renamed).
rnm ./* -ns '/fn//id/' -fo                 # file only mode, directories will be ignored.
rnm ./* -ns '/fn//id/' -fo -dp -1          # recursive to subdirectories all the way.

share|improve this answer

Windows has a really good program for this called Bulk Rename Utility. Here is the URL:

There is a unicode Windows 98 version that is portable. I put that in a folder on my Linux system (Mint Maya) and when I run it through Wine it works like a charm. The gui is very easy to use and very flexible.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.