Treefilesize <AUTHENTIC>
#DevTools #Linux #StorageManagement treefilesize Display directory tree with file sizes and total folder usage. Installation
#!/bin/bash tree -h --du "$@" (Note: GNU tree supports -h for human-readable sizes and --du for disk usage.)
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: treefilesize
git clone https://github.com/yourname/treefilesize cd treefilesize sudo cp treefilesize /usr/local/bin/
treefilesize is essentially a wrapper script (bash, Python, or PowerShell) that traverses directories and outputs a tree where each file shows its size and directories show aggregated or individual sizes. Or used du -sh but missed the hierarchical clarity
Ever run tree and wished you could see file sizes right next to each item? Or used du -sh but missed the hierarchical clarity? Enter treefilesize — a simple but powerful command-line utility that displays directory structures along with human-readable file sizes.
Example:
Or write your own Python script to color-code big files red.