0

On my Fedora 35 system neither of the following are working. I have about twenty or so jpg files in a directory, and I wish to add the name of a website to each image after its main title. I am certain that on Linux Mint the rename command worked perfectly, whereas the mmv I downloaded in case there was some problem on Fedora returns a 'no match...Nothing done' error.

mmv '*.jpg' '-new-suffix.jpg'

or

rename 's/\.jpg/-new-suffix.jpg/g' *jpg

I have checked the permissions on all files - they are 777 - and the directory itself also has 777 permissions.

I was expecting to see a list of files ending in ...-new-suffix.jpg but nothing has been changed with either of these commands.

3
  • 2
    What is the output of file "$(which rename)"? I believe the default rename executable on RedHat based systems is the rename from util-linux and that has a completely different syntax, you seem to be expecting perl-rename. What's with all the renames: prename, rename, file-rename?
    – terdon
    May 4, 2022 at 21:12
  • Output is: /usr/bin/rename: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=2420eb90bf8c8380cc7f4a01b466d1a9e9247d6d, for GNU/Linux 3.2.0, stripped
    – Hektor
    May 4, 2022 at 21:14
  • @terdon, though note that the post there explicitly says "I also have rename.ul from util-linux but let's ignore that one for now." (I think I've tried to look for the perl rename vs. util-linux rename thing before...)
    – ilkkachu
    May 4, 2022 at 21:36

1 Answer 1

4

You are missing the replacement marker. Try this instead:

mmv '*.jpg' '#1-new-suffix.jpg'
2
  • Thanks, this has worked perfectly.
    – Hektor
    May 4, 2022 at 21:10
  • 1
    @Hektor that's great. Please remember to accept the best answer with the ✔ May 4, 2022 at 21:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .