Created
August 15, 2015 09:10
-
-
Save Phlow/4801282897064d20330e to your computer and use it in GitHub Desktop.
A collection of methods to rename files in terminal
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
# | |
# Rename multiple files and replace name with number and prefix | |
# %02 › digits of numbers (increase when lots of files) | |
# | |
# counter=1 | |
# for i in *.* | |
# do new=$(printf "%02d.jpg" "$counter") | |
# mv -- "$i" "screenshot-realaudio-$new" | |
# let counter=counter+1 | |
# done | |
counter=1;for i in *.*; do new=$(printf "%02d.jpg" "$counter"); mv -- "$i" "screenshot-$new"; let counter=counter+1;done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment