Skip to content

Instantly share code, notes, and snippets.

@Phlow
Created August 15, 2015 09:10
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 Phlow/4801282897064d20330e to your computer and use it in GitHub Desktop.
Save Phlow/4801282897064d20330e to your computer and use it in GitHub Desktop.
A collection of methods to rename files in terminal
#
# 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