Dfdu: Fast disk usage browser for the terminal and desktop

(github.com)

116 points | by b--l 4 days ago ago

48 comments

  • bloopernova 2 days ago ago

    Since there's a few shares of people's disk usage apps, I wanted to pitch in too.

    https://tangled.org/zip.mu.social/getael

    Getǣl is a read-only cross-platform home directory disk usage visualizer. It's written in Rust, runs in a tray or as a service, and opens a browser view with no less than 8 different views of what is using space in your homedir. I wanted it restricted to my $HOME because that was where most of the space was being used, mostly on Rust/cargo builds, but also the Library folder on macOS was bugging me.

    It stays in memory and reads file events to keep up to date with your disk usage, saving it in a trimmed down sqlite db. Also shows time machine local snapshots if that's enabled on your macOS box. I think the constellation view is my favourite :)

    (tangled is a git host that runs on ATProto, the same thing behind Bluesky)

    • ktm5j 2 days ago ago

      Thanks for sharing, this looks awesome! Any chance you'd consider adding support for ZFS snapshots? That would be pretty useful for me.

      • bloopernova 2 days ago ago

        I'm unfamiliar with ZFS, but I can add that feature. I've created an issue to track this on Tangled, and will probably get it done by the end of this weekend.

        https://tangled.org/zip.mu.social/getael/issues/50

        • ktm5j 2 days ago ago

          Sweet! :D

      • bloopernova 2 days ago ago

        I'll definitely look into it. I hadn't yet considered backups outside of time machine, but it definitely fits the same niche!

        Thank you for the praise, very much appreciated

    • socks 2 days ago ago

      really nice visualisations!

      • bloopernova 2 days ago ago

        Thanks! Some are more useful than others, the fossil/dust one is good for big/old files. The constellation circles one is good for at a glance what is the worst offender in a group of directories. The others are mostly for navigation or personal preference.

        Taking suggestions on ways to improve the others, or just fork and add your own, then upstream PR, whatever your preference is.

  • baalimago 2 days ago ago

    Neat! I don't mean to do the classic HN "comment to promote other thing" (even if I technically am), but I built https://github.com/baalimago/duls which also spawned from wanting to have a faster du/df experience. Pivot I took with duls is to bake in context from files directly into the view, and summarize "all you need to know" into a limited terminal space (as opposed to a tui). It also scans until the time runs out, giving best effort within that window, continuously appending context.

    It's not at all as feature complete as Dfdu, and it doesn't try to be. Might serve for some inspiration for features. Good job OP!

  • Tepix 2 days ago ago

    Why not upstream improvements to ncdu? Have you tried?

    • wging 2 days ago ago

      Yorhel, the author of ncdu, died earlier this year (March).

      • matltc 17 hours ago ago

        Rip. Great tool

  • forgotpwd16 2 days ago ago

    Looks very nice. Compared to ncdu, good added features w/o bloat. For NTFS drive scans (especially since also targets Windows), rather (assume does) using a regular "walk every directoy" approach, can utilize MFT for improved speed. (What WinDirStat's doing.) Also, one of the rare occasions project doesn't brand itself "written in Rust".

  • virtualritz 2 days ago ago

    Shameless plug: I have been maintaining an ocy fork [1].

    ocy is a Rust CLI for cleaning up build caches, etc. I.e. it only does that part but tries to do it fast and thorough. It e.g. finds worktrees in hidden folders and the like.

    It is also parallelized and usually takes seconds to build a list of stuff that can go. It supports filtering by language/tooling.

    https://github.com/virtualritz/ocy

  • dimator 2 days ago ago

    Something I'm curious about:

    https://github.com/jordond/dfdu/commits/main/

    The commit history is roughly 99% bot generated, tweaking dependency versions. What's the value of all these? Is it to mostly simulate an active project?

    • newphone733 2 days ago ago

      This is a dependency updater bot. Nothing underhanded about it. Many projects release a lot of new versions now because of all the vulnerabilities, so bots like this are busy indeed. They are useful, because manually bumping all dependencies would be a lot of toil.

      • unrented7977 2 days ago ago

        I'm still of the opinion that automated dependency updating is worse than no updating. Who knows what kinds of supply chain attacks you're completely blind to?

    • jordond 2 days ago ago

      That's just Renovate doing it's thing. I'm pushing a PR that makes Renovate group the dependencies more so that it doesn't clog up the commit history as much .

      I finished all the features I wanted last month, so that's why there hasn't been many other commits.

  • socks 2 days ago ago

    I slopped up my own basic version of this a few weeks ago that deduplicates Copy on Write usage on APFS - and with very similar ideas in a few places [albeit mine has MCP suggestions rather than a rule engine], but yours looks much prettier. https://github.com/timkrins/apdu

  • wanghq 2 days ago ago

    Nice, wish you great success so you can acquire my dfdu.com in the future :)

    • socks 2 days ago ago

      he already has the very solid dfdu.app

  • bloopernova 2 days ago ago

    b--l my repo https://tangled.org/zip.mu.social/getael/tree/dev has some different ways of displaying disk usage that you might find useful. The fossil/dust and constellation views are the ones I've found most useful.

  • wolfi1 2 days ago ago

    why should I install this via 'curl | sh'?

    • jordond 2 days ago ago

      Unless you've read the install.sh script you probably shouldn't . I put that as an option as that's common these days. I would personally use a package manager.

    • goodpoint 2 days ago ago

      You shouldn't.

    • bdzr 2 days ago ago

      because it's no less safe than installing through a package manager; that code hasn't been audited either.

      • subscribed 2 days ago ago

        It's much, much safer to install it via package manager. Or even wget+less+cp.

        • bdzr 2 days ago ago

          > Or even wget+less+cp.

          Do you inspect the code you run when installing from a package manager? Those often can have hooks that run as root.

      • esafak 2 days ago ago

        That is wrong. Many package managers are scanned and are subject to more scrutiny.

        Use a package manager.

        • bdzr 2 days ago ago

          What do you mean scanned? Is this something new with the advent of LLMs?

          What do you mean subject to more scrutiny? My understanding is the initial commit is scrutinized, and afterwards changes go through completely unreviewed. No Debian (for example) maintainer is checking release diffs to "over 70,000 packages".

          • esafak 2 days ago ago

            Scanned by companies like Snyk and Socket.

        • vinyl7 2 days ago ago

          Tell that to Arch

    • forgotpwd16 2 days ago ago

      Convenience? There're few other ways shown on README/INSTALL pages if want less obscure method. Ironically `https://dfdu.app/llms.txt` is quite nice native language TL;DR to project's README/INSTALL pages.

  • CodeCompost 2 days ago ago

    I'm nervous about downloading and installing unknown software these days...

    • bloopernova 2 days ago ago

      If you have access to an LLM you can point it at a repo and ask "is there any harmful code in there?"

      Or anything you want about a repo, it's pretty useful for learning new stuff.

  • hikarudo 2 days ago ago

    Nice work!

    Speed comparison:

    1.2TB, around 28M files

    dfdu: 1m35s

    gdu: 12s

    • cygn 2 days ago ago

      yeah measured similar. dfdu 65sec, gdu 4 sec. sticking with gdu.

  • webprofusion 2 days ago ago

    Looks great! I'm not convinced it's any faster than Treesize Free currently

    • webprofusion 2 days ago ago

      I like the Cleanup view !

      • webprofusion 2 days ago ago

        Seems to have a bug (Windows) where it like small files (like json) are Exabytes in size (EiB) so they appear before GB sized files. This in the "Largest" view.

  • ece 2 days ago ago

    Mentions ncdu, but musl binary?

  • pcj-github 2 days ago ago

    loving this

  • Kushvinthe 2 days ago ago

    Been using ncdu and gdu for years, curious how this compares on speed for huge directories with lots of small files (like node_modules). Having both a TUI and a desktop UI in one tool is a nice touch though.

    • pragmatick 2 days ago ago

      5.5 seconds for dfdu, 8.5 seconds for ncdu on my projects folder (1.4 million items).

      10 seconds for dfdu, 23 seconds for dfdu on my home directory (2.6 million items).

      • gozucito 2 days ago ago

        > 10 seconds for dfdu, 23 seconds for dfdu on my home directory (2.6 million items).

        I assume your last dfdu was meant to be ncdu ?

        Thanks for the numbers! This looks extremely promising! 30-60% faster is incredible.

        Great job OP! Way to reduce the amount of suffering in the world! ;)

        • pragmatick 2 days ago ago

          >I assume your last dfdu was meant to be ncdu ?

          Yes, sorry for the typo.

  • oniconnect 2 days ago ago

    [dead]