Created
August 29, 2014 03:01
-
-
Save martindrapeau/561616cf5b5ed9fc58a6 to your computer and use it in GitHub Desktop.
Rename files replacing non ASCII by _
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find /path/to/files -type f -print0 | \ | |
| perl -n0e '$new = $_; if($new =~ s/[^[:ascii:]]/_/g) { | |
| print("Renaming $_ to $new\n"); rename($_, $new); | |
| }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment