Treefilesize

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 + '│ ')

alias tfs='tree -h --du' alias tfs-large='tree -h --du -L 2 | grep -E "\[.*M\]"' 🧠 Disk space mystery? Try treefilesize – a visual tree of your folders with file sizes attached. No more guessing where all your storage went. treefilesize

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

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

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

git clone https://github.com/yourname/treefilesize cd treefilesize sudo cp treefilesize /usr/local/bin/

Want only large files? Pipe to grep: tree -h --du | grep "M\|G"