Skip to content

Instantly share code, notes, and snippets.

@yui0
Created March 29, 2020 09:54
Show Gist options
  • Save yui0/58dac1a34aa2c4339c8aa691391d9d03 to your computer and use it in GitHub Desktop.
Save yui0/58dac1a34aa2c4339c8aa691391d9d03 to your computer and use it in GitHub Desktop.
#!/bin/sh
i=1
#for f in $(ls -1 *.jpg | sort -t'-' -k2h)
ls -1v *.jpg | while read f
do
mv "$f" $(printf "%04d.jpg" $i)
: $((i++))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment