Created
May 18, 2017 00:07
-
-
Save vladimirmyshkovski/c846070fbafc62b17c028921ab021702 to your computer and use it in GitHub Desktop.
find all files and get size in bytes, python
This file contains hidden or 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
In [11]: import os | |
...: for root, dirs, files in os.walk('/var/www/gglobal/media/images/'): | |
...: for fn in files: | |
...: path = os.path.join(root, fn) | |
...: size = os.stat(path).st_size | |
...: print('{} {} bytes'.format(path.split('/')[-1], size)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment