Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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