Skip to content

Instantly share code, notes, and snippets.

@makokal
Created January 25, 2013 15:57
Show Gist options
  • Save makokal/4635508 to your computer and use it in GitHub Desktop.
Save makokal/4635508 to your computer and use it in GitHub Desktop.
Batch rename a number of files appending 0s before extension to preserve alphabetical ordering e.g. after collecting images from camera to make a video with mencoder
# EXT is the extension of the files
rename 's/(\d+)\.EXT/sprintf("%03d.EXT", $1)/e' *.EXT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment