Skip to content

Instantly share code, notes, and snippets.

@graphbear
Last active August 29, 2015 14:09
Show Gist options
  • Save graphbear/12bf5b91e11b9b897231 to your computer and use it in GitHub Desktop.
Save graphbear/12bf5b91e11b9b897231 to your computer and use it in GitHub Desktop.
lowercase names of all sub-directories and files
#!/usr/bin/python
# This script will rename in lower case every file and directory found in the
# current directory and below.
import os
for root, dirs, files in os.walk('.'):
for filename in files:
old_name = os.path.join(root, filename)
new_name = old_name.lower()
print old_name + ' --> ' + new_name
os.renames(old_name,new_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment