Last active
September 7, 2017 00:23
-
-
Save toshinarin/17e839f49f79180ba1e298f71272598a to your computer and use it in GitHub Desktop.
Renaming files to sequential numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Reference: https://www.raspberrypi.org/forums/viewtopic.php?t=72435 | |
# https://stackoverflow.com/questions/3211595/renaming-files-in-a-folder-to-sequential-numbers | |
ls -l *.jpg | awk '{print $NF}' | gawk 'BEGIN{ a=1 }{ printf "mv %s %06d.jpg\n", $0, a++ }' | bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment