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?.

Uri Herrera
  • 14,866

2 Answers2

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 *

  • 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. – Uri Herrera Oct 31 '12 at 23:50
  • Please check the version of rename before using it. https://askubuntu.com/a/1024963/542527 – Gautam Sreekumar Mar 01 '22 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.

carestad
  • 993