Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 7 down vote accepted

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.

share|improve this answer
    
@Mik thanks! edited :) –  carestad Nov 1 '12 at 0:48

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 *

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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