Skip to content

Instantly share code, notes, and snippets.

@lbj96347
Created January 19, 2018 02:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbj96347/6ddcd3aa7b90587dca0b14cfc9746c99 to your computer and use it in GitHub Desktop.
Save lbj96347/6ddcd3aa7b90587dca0b14cfc9746c99 to your computer and use it in GitHub Desktop.
This bash script can allow you to manage your aerial photos in one mission more easier.
#!/bin/bash
a=1 #a is for the first number
for i in *.JPG; do #Replace JPG, then you can edit your file extension
new=$(printf "%04d.JPG" "$a") #04 pad to length of 4
mv -i -- "$i" "$new"
let a=a+1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment