0

I have folder with 1000 JPG files like this:

17.png.jpg
341.png.jpg
882.png.jpg
997.png.jpg
1023.png.jpg

I need to rename all the list so the number will stay and remove just the ".png" Result expected:

17.jpg
341.jpg
882.jpg
997.jpg
1023.jpg

What is the linux/mac command I should run?

Asi
  • 395
  • 4
  • 13
  • Does this answer your question? [Rename multiple files based on pattern in Unix](https://stackoverflow.com/questions/1086502/rename-multiple-files-based-on-pattern-in-unix) – Sebastian Kaczmarek Feb 16 '22 at 07:46

1 Answers1

1

If you have bash available, you can type

for i in *.png.jpg
do 
    mv "$i" "${i%.png.jpg}.jpg"
done
Mathieu
  • 8,840
  • 7
  • 32
  • 45