Rename Not Working [Closed]

Rename Not Working [Closed]

I have a bunch of files with names like

... (Karton 1).jpeg

and would like to rename them recursively to:

... (brauner Karton).jpeg

I tried the following commands, which didn't work:

rename -v 's/Karton 1/brauner Karton/g' *
rename -v 's/Karton 1/brauner Karton/g' *.jpeg

According to a lot of examples this shouldn't be that hard. What am I doing wrong?

Aditional info: "Karton 1" would be "[B/b]ox 1" in English.

6

1 Answer

There are several versions of the rename command. Use rename --version to determine which you have, they use different syntax.

$ rename --version
/usr/bin/rename using File::Rename version 0.20
$ rename 's/\.jpeg$/.jpg/' *

$ rename --version
rename from util-linux 2.30.2
$ rename .jpeg .jpg *
4
Marcus Vance
Author

Marcus Vance

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.