Treefilesize May 2026
Type: tree -h --du – boom. You see every folder and file with sizes in KB, MB, GB.
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 + '│ ') treefilesize
Stop guessing. Start visualizing. Like and subscribe for more CLI hacks. Type: tree -h --du – boom
Open your terminal. Ever run du -sh and gotten confused? Or ls -la and lost track? Start visualizing
git clone https://github.com/yourname/treefilesize cd treefilesize sudo cp treefilesize /usr/local/bin/
project/ ├── README.md (1.2 KB) ├── data/ (24 MB) │ ├── raw.csv (18 MB) │ ├── clean.csv (6 MB) ├── scripts/ (8 KB) │ ├── analyze.py (4 KB) │ ├── utils.py (4 KB) └── output/ (512 MB) └── results.pdf (512 MB) Save this as treefilesize and add to your PATH: