Skip to content

Instantly share code, notes, and snippets.

View Hawaiideveloper's full-sized avatar
🎯
Focusing

Corey Albright Hawaiideveloper

🎯
Focusing
View GitHub Profile
@Hawaiideveloper
Hawaiideveloper / move.py
Created June 17, 2016 17:43 — forked from vadviktor/move.py
Python: move files to creation date named directories
#!/usr/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))
ctime_dir = str(ftime.tm_year) '-' str(ftime.tm_mon) '-' str(ftime.tm_mday)
if not os.path.isdir(ctime_dir):
os.mkdir(ctime_dir)