Show HN: Leaves – A text-UI disk usage treemap visualizer
GUI disk analyzers are great for figuring out what's filling up your laptop/desktop drive. On containers or remote servers, the options are limited to purely text based utilities (e.g. du) or list-centric TUIs (e.g. ncdu) which are usually limited to viewing one directory at a time. I created leaves to fill that gap. Inspired by classic utilities like WinDirStat and KDirStat, it uses a 2-dimensional treemap^1 visualization to show the entire directory hierarchy with proportionally sized rectangles. It's performant enough to handle millions of files, thanks to Rust and multi-threading. However, block characters aren't as suited as pixels for resolving a large number of items. Leaves can show file-type summaries per directory or partition the top-level directories by extension, allowing you to see not only where space is being used, but also how. For instance, I can see the largest chunk of my home directory is taken up by uv caches for python and old Linux ISOs that I could easily re-download if needed. Or in a particular container, +600MB is used by standard Rust documentation and tutorials, and that it is the only location with HTML/JS files, when only the libraries and build tools are needed (note to self: remember to use the minimal profile next time). ^1: https://github.com/shundhammer/qdirstat/blob/master/doc/Tree...
Discussion Highlights (18 comments)
bescob_ar
This looks fantastic, reminds me a lot of SpaceSniffer. The focus view or allowing for navigation through chunks is a nice essential inclusion. One desire might be quick actions. Doing size of squares based on the # of packages a dependency installation causes: Helps I guess users hellbent on having their install minimal figure out what they can afford to remove for as few packages on their system as reasonably possible.
robertclaus
Ooh, this is nice. I loved windirstat back in the day.
sghiassy
Really cool. If possible, being able to “brew install” on a Mac would be killer
takencoder
Nice! The file-type extension partitioning feature is a really smart addition to handle the limitations of block characters.
rrauenza
I had just been looking for a windirstat like tool for linux the other day. What I really also want is a way to do an offline index that this reads ... I ended up using duc. Maybe I will fork and add it! thanks for sharing!
azeirah
Love it! If this works well I'm going to add it to my basic linux tools toolkit next to htop and the like.
ktm5j
This is super cool, I've always used ncdu for this kinda thing but I like this a lot better. Thanks for sharing!
KaiserPro
Ooo a TUI version of Sequoia view: https://sequoiaview.win.tue.nl/ nice
1970-01-01
This is the kind of tool that should be baked into the kernel. It's never there when you need it, and when you do need it, it is probably already a full disk and you maybe can't just download it.
douglee650
Is this faster than diskx inventory or other gui tools?
codingstark
this is really helpfull
vadansky
Surprised no one mentioned WizTree which is a lot faster than WinDirStat
dbdoskey
There is also dua-cli or mcdu, if someone prefers a ncdu-style disk usage visualizer.
antihero
Broot (br -w) can also do this (not with the big rectangles)
xp84
Love this! A few similar GUI apps have been mentioned for Windows. For Mac, I've been using GrandPerspective for probably 15 years. This is one of my favorite class of programs in terms of how uniquely useful they are. A pity we can't use something like this (and actually take action on the results) on closed systems like iOS (I've just had to factory reset my iphone to rein in a 37GB "system data" mess... even on the newly restored phone that consumes 15GB but at least that's better).
SamPentz
I love this
dunham
That looks like a nice tool. It would be helpful if it could optionally run off of a data file. I've used "ncdu" to visualize my restic backups by writing a script that generates the ncdu data format, and more recently I've abused ncdu to visualize process memory usage on macos: https://gist.github.com/dunhamsteve/59f5e6b9a4bc69039853674d...
joshka
Ratatui maintainer here. Looks great! I've had on my someday bucket list doing up a web based version of daisy disk as a docker image I can slap on my various servers, but this is probably just as good an approach. I like it.