Rename *.jpeg.png to *.png in linux

#!/bin/bash

# Change to the directory containing the image files
cd /path/jpg

# Loop through all the files with the .jpeg.png extension
for file in *jpeg.png; do
    # Remove the "jpeg" part from the file extension
    new_filename="${file/\.jpeg/}"

    # Rename the file
    mv "$file" "$new_filename"
done

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.