[Bash] Rename Files in Directory to Lowercase
Convert the name of files in directory to lowercase via Bash script.
#!/bin/bash
# $1 is the directory in which files to be renamed to lowercase
for path in $(find $1 -type f)
do
dir=$(dirname ${path})
file=$(basename ${path} | tr "[:upper:]" "[:lower:]")
mv ${path} ${dir}/${file}
done
References:
[1] | [Bash] List All Files in Directory Recursively and Rename |
[2] |
[3] |
[4] |