Skip to content

Instantly share code, notes, and snippets.

@bergpb
Created April 9, 2018 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bergpb/a015bd82bd8cf0b44b092f05b6486999 to your computer and use it in GitHub Desktop.
Save bergpb/a015bd82bd8cf0b44b092f05b6486999 to your computer and use it in GitHub Desktop.
import os
import sys
#check if sys.argv is set:
if len(sys.argv) > 1:
dir = sys.argv[1]
else:
dir = os.getcwd()
#go to dir
os.chdir(dir)
#for in all folders
for folder in os.listdir(dir):
os.system('du -msh %s' % folder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment