Skip to content

Instantly share code, notes, and snippets.

@404mike
Created June 24, 2014 12:05
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 404mike/17bf6470428cf01d9cee to your computer and use it in GitHub Desktop.
Save 404mike/17bf6470428cf01d9cee to your computer and use it in GitHub Desktop.
Remove white space and change file name to lowercase
#!/bin/bash
ls | while read -r FILE
do
mv -v "$FILE" `echo $FILE | tr ' ' '_' | tr -d '[{}(),\!]' | tr -d "\'" | tr '[A-Z]' '[a-z]' | sed 's/_-_/_/g'`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment