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

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

find ./ -name '*.png.png' -type f \
        -exec sh -c 'mv {} ./$(basename -s .png.png {}).png' \;

Tags:

Leave a Comment

Your email address will not be published. Required fields are marked *

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