Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

12 Answers 12

up vote 31 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
3  
pyRenamer is not bad at all. –  skalka Oct 31 '10 at 19:20
1  
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 at 9:48

Métamorphose

http://file-folder-ren.sourceforge.net/

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

share|improve this answer

http://tips.webdesign10.com/how-to-bulk-rename-files-in-linux-in-the-terminal might help you. But it uses the command line.

share|improve this answer
2  
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

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.

http://www.nongnu.org/renameutils/

share|improve this answer

thunar file manager is a GUI with a bulk rename option

http://thunar.xfce.org/pwiki/documentation/bulk_renamer

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

share|improve this answer

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

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
1  
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

Windows has a really good program for this called Bulk Rename Utility. Here is the URL: http://www.bulkrenameutility.co.uk/Main_Intro.php.

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

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

protected by Braiam Mar 1 at 13:28

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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