Skip to content

Instantly share code, notes, and snippets.

@pyratebeard
Created December 19, 2016 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyratebeard/74b9345948fc7cacae973cb7628e0ae8 to your computer and use it in GitHub Desktop.
Save pyratebeard/74b9345948fc7cacae973cb7628e0ae8 to your computer and use it in GitHub Desktop.
#!/bin/bash
targetDir=$1
cd $targetDir
for i in *; do
if [ ! -f "$i" ]; then
continue
else
mv "$i" $(echo "$i" | tr "[:upper:]" "[:lower:]" | tr " " "_")
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment