12

I have only spent 5 months with Ubuntu and it has been an awesome experience, I hardly boot into Windows now, but there are some things I miss, like the Bulk Rename Utility I used to have in Windows.

I use the program a lot when I boot into Windows but I'd prefer if there was an alternative or something similar cause the program had a plethora of renaming options with a decent gui.

I'm aware of the rename command in terminal, but I've never had any luck with it.

A screenshot of what it looks like: A screenshot of what it looks like

Questions

  • Is there an alternative of this program for Ubuntu?
  • A great command line resource on how to get this done without a gui?
18

But... But... You've already found the answer... rename really is the best thing since sliced bread. If you need some examples of it doing really cool things, I've written a few in my time here:

If you need specific help, ask and somebody here can deliver.

Failing that simple Bash scripting is an option in most cases.

Sidebar: I defy anybody to call rename or regular expressions complicated after you've seen the screenshot of Bulk Rename Utility. Holy balls, I almost forgot how ugly it was.

  • 1
    For one. BRU might be ugly, but it doesn't require remembering and escaping a syntax that compares unfavorably to serial line noise. – Mikey T.K. Mar 31 '18 at 20:17
9

There is the Bulk Rename utility, which is part of Thunar, the default file manager of XFCE desktop environment (the one used by Xubuntu). Selecting multiple files in Thunar and selecting "rename" opens the tool, but it can also be started separately.

enter image description here

It has different options of action, which together may come close to those of the Windows tool.

This documentation may be of help.

Some details also here (mentioning other tools too).

enter image description here

If you prefer to use a different file manager, you may still use this tool. It cannot be installed separately from Thunar but the latter brings very few specific dependencies and can be installed easily. The tool can be started separately though, and can even be integrated as a custom menu action in other files managers like Dolphin and Nautilus.

Example for Dolphin: create the file ~/.local/share/kservices5/bulk-rename-thunar.desktop with these lines:

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=all/all;
Actions=BulkRename;
X-KDE-StartupNotify=false
X-KDE-Priority=TopLevel

[Desktop Action BulkRename]
Name=Bulk Rename
Exec=thunar -B %U
Icon=dialog-information
  • 2
    A great advantage of this tool is that it can operate on files directly (unlike pyrenamer and metamorphose2 which can only select folder paths and therefore cannot be used with a context menu action) and then it opens a list of files that can be modified by drag & drop etc. A disadvantage is that it lacks an undo option. – user47206 Mar 2 '18 at 11:07
  • @cipricus thank you for the added info (almost should be communtiy wiki....). Sadly think the undo option is backing up! – Wilf Mar 2 '18 at 15:39
  • bugzilla.xfce.org/show_bug.cgi?id=14257 – user47206 Mar 2 '18 at 15:53
5

GPRename and pyRenamer are available in the repositories. Both are similar and easy to use, although pyRenamer is a dead project.

5

Pyrenamer is my tool of choice. It's straightforward to use and has a preview mode.

sudo apt-get install pyrenamer

More details from here:

enter image description here

enter image description here

  • 1
    The same problem as with metamorphose2 mentioned in my answer: it cannot access only some files directly, but needs a folder path in which then files need to be selected; but selecting only some files to be renamed out of tens or hundreds is very difficult. A solution would be to put the files concerned into a separate folder before using this. – user47206 Mar 2 '18 at 10:55
  • not available directly in 18.10 – user47206 Dec 6 '18 at 16:58
3

I have found a lot of details on tools already mentioned under this question at http://www.webupd8.org/2016/03/quickly-batch-rename-files-in-linux.html, and I have edited the answers mentioning them in order to add such details.

There is another tool mentioned there that seems the most advanced:

Metamorphose2

Here's its presentation at the above address:

enter image description here

enter image description here

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install metamorphose2

I have used Thunar bulk rename for a long time but the above is much more complex and has a feature that I was missing, the option to undo changes.

This tool seem less intuitive and complicated for simple operations. (A great advantage of the Bulk Rename tool in Thunar is the ability of having a list of files outside the file manager that can be modified easily by drag&drop.)

But once you understand how it works it can be useful.

A few tips:

  • You are supposed to first select the "Picker" tab. But by default all files and folders (of the selected path) are selected and, if you do not want to rename them all, you have to un-select them all by clicking "none" and then select them one by one with single-left-click. (I find this annoying, and prefer to put all files that need renaming in a separate folder, and then select the "Picker" tab. - As far as I can tell, that would be the way to go for the Windows tool mentioned in the question either, as its behavior is similar.)

  • Once the files are selected, go to the "Renamer" tab and select one of the "Available" actions by double-clicking it. It all becomes available from this point forward.


For what it's worth - the Windows program Bulk Rename Utility works fine in Wine/Playonlinux.

  • BRU does indeed work well under Wine. Thanks for pointing that out! :) – Dɑvïd Apr 14 '18 at 13:41
  • Metamorphose2: 'Unable to locate package metamorphose2' as of Ubuntu 19.04. – VanAlbert Jun 17 at 21:05
1

You may want to check this one: rnm (web page).

Some Usage:

rnm file-name -ns new-filename             # signle file
rnm ./* -ns '/fn//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.

etc...

To undo an unwanted rename:

rnm -u

You can find more examples/docs here.

1

Bulk rename utility does work with linux via wine. But it get hangs on certain operations. We will get used to it and we will automatically skip doing such operations after familiarizing them. I am very satisfied with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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