Skip to content

Instantly share code, notes, and snippets.

@neklaf
Created February 1, 2020 10:18
Show Gist options
  • Save neklaf/704c7cf6336243ce543f31cf1c99be48 to your computer and use it in GitHub Desktop.
Save neklaf/704c7cf6336243ce543f31cf1c99be48 to your computer and use it in GitHub Desktop.
Rename files to lowercase
#!/bin/sh
if [ -z "$1" ] ;
then
printf "Specify a directory name.\n"
exit 1
fi
sudo apt update && apt install rename
find $1 -depth -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment