Skip to content

Instantly share code, notes, and snippets.

@christophchamp
Created June 19, 2015 20:16
Show Gist options
  • Save christophchamp/844b65e835bd9baea074 to your computer and use it in GitHub Desktop.
Save christophchamp/844b65e835bd9baea074 to your computer and use it in GitHub Desktop.
# Rename:
# FROM: "Introduction___Networking_tutorial_(1_of_13)-qHzZUmP1vvON.mp4"
# TO: "nettut-01_of_13_-_Introduction-qHzZUmP1vvON.mp4"
for f in *.mp4; do \
[[ $f =~ ^(.*)___Networking_tutorial_\(([0-9]+)_of_13\)-(.*)$ ]]
mv "$f" "nettut-$(printf "%02d" ${BASH_REMATCH[2]})_of_13_-_${BASH_REMATCH[1]}-${BASH_REMATCH[3]}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment