How to batch rename images, in reverse numerical order?
Solution 1:
You can use an Automator Workflow.
Something like this:
Sort Finder Items step will sort image names descending (IMG_0003.jpg, IMG_002.jpg, IMG_001.jpg).
Make Sequential step will rename them sequentially (IMG_0001.jpg, IMG_0002.jpg, ...).
Copy Finder Items step is optional, just to be sure not to mess with original files.
Solution 2:
Here's another shell script. You can save it as a normal text file and then run bash /path/to/script.sh
from Terminal. Remove the echo
to actually rename the files.
cd ~/Pictures/
IFS=$'\n' # the input field separators include space by default
i=1
for f in $(ls -r IMG*.jpg); do
echo mv "$f" "IMG_$(printf %04d $i)".jpg
(( i++ ))
done