Return to Snippet

Revision: 37168
at December 5, 2010 08:48 by Carolyne


Initial Code
i=1
for file in *.jpg
do
        j=$( printf "%04d" "$i" )
        mv "$file" "$j.jpg"
        (( i++ ))
done

Initial URL

                                

Initial Description
Found on the Ubuntu forum: http://ubuntuforums.org/showthread.php?t=1355021

Renames files to 0001.jpg, 0002,jpg etc

You can insert a prefix here: "prefix-$j.jpg"

Initial Title
Rename files to concesutive numbers

Initial Tags
Bash, files

Initial Language
Bash