Skip to content

Instantly share code, notes, and snippets.

@Andsbf
Created April 15, 2020 09:41
Show Gist options
  • Save Andsbf/5636cb1909d99f5e749662dfd4ec0de6 to your computer and use it in GitHub Desktop.
Save Andsbf/5636cb1909d99f5e749662dfd4ec0de6 to your computer and use it in GitHub Desktop.
#!/bin/bash
n=0; ls -tr | while read i; do n=$((n+1)); mv -- "$i" "$(printf '%03d' "$n").JPG"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment