This is how I was doing it before I saw the one liner <snip> #!/usr/local/bin/python # ren_to_upper.py import os for fname in os.listdir(os.getcwd()): newfname = fname.upper() os.rename(fname, newfname) </snip>