Skip to content

Instantly share code, notes, and snippets.

@aferriss
Last active July 12, 2017 21:12
Show Gist options
  • Select an option

  • Save aferriss/d544c28b6957f68771c1dd75aa96081c to your computer and use it in GitHub Desktop.

Select an option

Save aferriss/d544c28b6957f68771c1dd75aa96081c to your computer and use it in GitHub Desktop.
Batch Rename with Padded Zeros
#just run from current directory
# will rename all files to 00001.jpg 00002.jpg etc.
ls | cat -n | while read n f; do mv "$f" `printf "%05d.jpg" $n`; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment