Overslaan en naar de inhoud gaan

Treefilesize [ GENUINE – 2027 ]

Open your terminal. Ever run du -sh and gotten confused? Or ls -la and lost track?

Meet treefilesize – a simple trick on top of the classic tree command. treefilesize

#!/bin/bash tree -h --du "$@" (Note: GNU tree supports -h for human-readable sizes and --du for disk usage.) Open your terminal

Stop guessing. Start visualizing. Like and subscribe for more CLI hacks. indent + '│ ')

#DevTools #Linux #StorageManagement treefilesize Display directory tree with file sizes and total folder usage. Installation

import os def tree_filesize(start_path, indent=''): for item in sorted(os.listdir(start_path)): path = os.path.join(start_path, item) size = os.path.getsize(path) if os.path.isfile(path) else 0 size_str = f"size/1024:.1f KB" if size < 1024 1024 else f"size/(1024 1024):.1f MB" print(f"indent├── item (size_str)") if os.path.isdir(path): tree_filesize(path, indent + '│ ')

Facebook icon   Twitter icon   treefilesize

Nieuwsbrief