How to rename rename *.png.png to *.png in Mac OS terminal

I always use this way to rename *.png.png to *.png

[code lang=”shell”]
find ./ -name ‘*.png.png’ -type f \
-exec sh -c ‘mv {} ./$(basename -s .png.png {}).png’ \;
[/code]

Tags:

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.