Last active
August 29, 2015 14:09
-
-
Save graphbear/12bf5b91e11b9b897231 to your computer and use it in GitHub Desktop.
lowercase names of all sub-directories and files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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