Jump to content
ElementaryOS France

[Bash] Renomer des images par lot


Recommended Posts

Placez vous dans le dossier contenant les images et exécutez le script.

 

#!/bin/bash
nom="Image"
let "indice=1"
for fichier in *.jpg *.JPG *.png *.PNG *.gif *.GIF *.jpeg *.JPEG
do
        if [ -f "$fichier" ]; then
           extension=${fichier##*.}
           echo "$fichier" "=>" "$nom-$indice.$extension"
           mv "$fichier" "$nom-"`printf "%02d" $indice`".$extension"
           let "indice+=1"
       fi
done

Edited by insomniaque
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...