Skip to content

Instantly share code, notes, and snippets.

@PerpetualBeta
Created October 27, 2012 10:23
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 PerpetualBeta/3964029 to your computer and use it in GitHub Desktop.
Save PerpetualBeta/3964029 to your computer and use it in GitHub Desktop.
Rename all files in a directory to their web-safe equivalents.
perl -e 'foreach $file (glob "*") { $dest_file = $file; $dest_file =~ s/ /_/sg; $dest_file =~ s/[^a-zA-Z_\-.0-9]//sg; rename $file, lc($dest_file) }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment