/ Published in: Bash

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"
Renames files to 0001.jpg, 0002,jpg etc
You can insert a prefix here: "prefix-$j.jpg"
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
i=1 for file in *.jpg do j=$( printf "%04d" "$i" ) mv "$file" "$j.jpg" (( i++ )) done
Comments
