Created
June 16, 2023 17:10
-
-
Save nucleardreamer/d70e7ecfea03f5f36dbfe044b73cd045 to your computer and use it in GitHub Desktop.
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/bash -e | |
find . -depth -not -path '*/\.*' | while read file ; do | |
directory=$(dirname "$file") | |
filename=$(basename "$file") | |
newfilename=$(echo "$filename" | sed 's/[^a-zA-Z0-9_. -]//g' | tr '[:upper:]' '[:lower:]') | |
if [ "$filename" != "$newfilename" ]; then | |
mv "$directory/$filename" "$directory/$newfilename" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment