Last active
November 21, 2016 08:23
-
-
Save molcay/9dc299da9c26efcffdb8aed49a0811ae to your computer and use it in GitHub Desktop.
This script can list all files and subfolders. Actually, 'du -h' command do the jobs the other part includes timestamp to the text file.
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 | |
import datetime | |
import os | |
import sys | |
now = datetime.datetime.now() | |
# print now.year, now.month, now.day, now.hour, now.minute, now.second | |
filename = "{}-{}-{}-{}-{}-{}".format(now.year, now.month, now.day, now.hour, now.minute, now.second) | |
suffix = "FileList" | |
if len(sys.argv) > 1: | |
suffix = sys.argv[1] | |
filename = suffix + filename | |
os.system("du -h > {}.txt".format(filename)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment