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

Last updated on April 8th, 2023 at 10:17 pm

#!/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:

Discover more from Juzhax Technology

Subscribe now to keep reading and get access to the full archive.

Continue reading