Skip to content

Instantly share code, notes, and snippets.

@denitram
Last active November 17, 2015 12:35
Show Gist options
  • Save denitram/40a0d39917b1886999c8 to your computer and use it in GitHub Desktop.
Save denitram/40a0d39917b1886999c8 to your computer and use it in GitHub Desktop.
rename files to lowercase
* quick and dirty
for i in `ls` ; do mv "$i" "$(echo $i | tr A-Z a-z)"; done
* beter version
for i in $(find . -type f -name "*[A-Z]*"); do mv "$i" "$(echo $i | tr A-Z a-z)"; done
-name "*[A-Z]*" ensures that only files with capital letters are found. For example, if files with only lowercase letters are found and moved to the same file, mv will display the are the same file error.
Thanks to Steve see: http://stackoverflow.com/questions/13051871/change-filenames-to-lowercase-in-ubuntu-in-all-subdirectories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment