Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rename files with shitty windows-1252 characters into normal format
#!/bin/bash
find -name *é* -exec rename 's/é/é/g' '{}' \;
find -name *è* -exec rename 's/è/è/g' '{}' \;
find -name *ç* -exec rename 's/ç/ç/g' '{}' \;
find -name *à* -exec rename 's/à/à/g' '{}' \;
find -name *ù* -exec rename 's/ù/ù/g' '{}' \;
find -name *ø* -exec rename 's/ø/ø/g' '{}' \;
find -name *â* -exec rename 's/â/â/g' '{}' \;
find -name *ë* -exec rename 's/ë/ë/g' '{}' \;
find -name *ÿ* -exec rename 's/ÿ/ÿ/g' '{}' \;
find -name *î* -exec rename 's/î/î/g' '{}' \;
find -name *ô* -exec rename 's/ô/ô/g' '{}' \;
# double escape for ? else it will be treated as regex expression
find -name *Ã?* -exec rename 's/Ã\\?/É/g' '{}' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.