Created
December 23, 2013 10:44
-
-
Save brain90/8094936 to your computer and use it in GitHub Desktop.
strip non alpha numeric for multiple filenames.
This file contains 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
#!/bin/sh | |
for old in *.mp3; do | |
new=$(echo $old | sed -e 's/[^a-zA-Z0-9\s\.]/_/g' | sed -e 's/_\+/_/g' | sed -e 's/_\./\./g') | |
mv -v "$old" "$new" | |
done | |
# Modified from: | |
# http://stackoverflow.com/questions/1961255/rename-files-using-a-regex-with-bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment