4

Following this question I exported various SVGs to PNGs, but there is a little problem, all files include in their name the extensions .svg and .png as in file.svg.png.

Now what I'd like to know is how can I remove the .svg string from the name of the file without going trough each file and do right-click>rename?.

2 Answers 2

11

I guess this answer to another question could help :)

Specific to the question:

rename s/".svg"/""/g *

General:

rename s/"**TO-BE-REPLACED**"/"**REPLACEMENT**"/g *

2
  • Thunar's rename tool is pretty much what I wanted yes, it helped. I wiil up-vote you as you lead me to it but not exactly solved it ;) perhaps you should add it. Oct 31, 2012 at 23:50
  • Please check the version of rename before using it. askubuntu.com/a/1024963/542527 Mar 1, 2022 at 16:53
8

pyrenamer is a pretty handy tool for batch renaming files. Otherwise, you could always fire up the terminal.

for file in *; do mv "${file}" "${file//\.svg/}"; done

That should do the trick if you're in the same directory as the pictures. Use at own risk.

0

You must log in to answer this question.

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