Skip to content

Instantly share code, notes, and snippets.

View ikluhsman's full-sized avatar
🤓
Feeling Nerdy

Ian Kluhsman ikluhsman

🤓
Feeling Nerdy
  • Self Employed
  • Denver, CO
View GitHub Profile
@ikluhsman
ikluhsman / move.py
Last active July 8, 2019 13:34 — forked from vadviktor/move.py
Python: move files to creation date named directories
#!/usr/local/bin/python3
import os, time, shutil, sys
dir = sys.argv[1]
os.chdir(dir)
for f in os.listdir('.'):
ftime = time.gmtime(os.path.getmtime(f))
year = str(ftime.tm_year)
mon = str(ftime.tm_mon)
day = str(ftime.tm_mday)
if len(mon) == 1: mon = "0" + mon