17 ms·
Ncdu – NCurses Disk Usage
- deleted 4y ago[deleted]
- mahemola 4y agoNice GUI to `du -h --max-depth=1 .` or `du --max-depth=1 . | sort -n -r`
- SSchick 4y agoThis tool has been pretty invaluable to me over the years in diagnosing/tracing high disk usage, particularly relevant for pypi and npm packages that were needlessly shipping huge artifacts.
- justusw 4y agoThis program is extremely useful. I have recently performed a recovery on a bricked Microsoft Surface and was able to extract all the useful files from a Windows home directory and quickly discard all the libraries, caches, and so on. By seeing the folders that take up the most space you can easily determine what the juicy bits in a folder hierarchy are. Huge time saver. Using GrandPerspective on macOS was a similar revelation, but ncdu being keyboard driven and allowing you to quickly launch a shell inside each folder and then apply find -exec there quickly is a productivity boost on yet another level.
- tjoff 4y agoReally nice tool, didn't know of the rewrite in Zig, the linked blog post discussing the rewrite it was good: https://dev.yorhel.nl/doc/ncdu2 https://dev.yorhel.nl/doc/ncdu2
- rwky 4y agoLove ncdu. I probably use it at least once a week somewhere debugging a disk that's getting full.
- mritzmann 4y agoIf you use a Btrfs filesystem with snapshots, I can recommend Btdu as an alternative. Advantage: Can handle duplicate files (snapshots), which however only occupy 1x disk space. https://github.com/CyberShadow/btdu https://github.com/CyberShadow/btdu
- thecosmicfrog 4y agoHave used btdu - very useful on Btrfs systems with lots of snapshots.
- belthesar 4y agoAt first blush, this beats the tar out of using other deduplicator strategies on btrfs. I'm looking forward to checking this out more thoroughly.
- aw1cks 4y agoThis looks very useful! I wish there were something similar for ZFS.
- aendruk 4y agoMore interesting than its support of Btrfs features is its unusual statistical approach: > btdu is a sampling disk usage profiler […] Pick a random point on the disk then find what is located at that point […] btdu starts showing results instantly. Though wildly inaccurate at first, they become progressively more accurate the longer btdu is allowed to run.
- patwolf 4y agoI never knew about this tool, but it looks quite useful--much better than just using df. The only thing I wish it had was a squarified treemap view of disk space. There was an old graphical tool for Windows called SequoiaView that I used to use years ago, and I've never found a worthy replacement for it on Linux or MacOS.
- jwr 4y agoSuch a great tool. Thank you! On a Mac, I've been using OmniDiskSweeper for years, but this can be run in a single directory and on my Linux machines as well. Fantastic! And look, it didn't ask me to sign up for an account, and it didn't require me to consent to usage data collection with a huge Privacy Policy attached! How is that possible? (still dealing with this morning's scars from trying, and failing to run the warp terminal)
- gfxgirl 4y agonow if it was just an executable file and didn't require a package manager or compiling to install it would be flawless.
- rwmj 4y agoNice tool - although with remote machines my go-to tool is KDE filelight, the joy of remote X11.
- Doctor_Fegg 4y agoncdu is fabulous. I used it a while back on my 2009 Mac mini and recovered 40GB of disk space. 8GB of this was in just four folders: ~/Library/Logs/CrashReporter/MobileDevice, /private/var/db/systemstats, /System/Library/Caches/com.apple.coresymbolicationd, and /Library/Caches/com.apple.iconservices.store.
- saagarjha 4y agoI would advise against deleting random things on your disk that are taking up space.
- farresito 4y agoIf you like ncdu, you might also like dua[0]. You can run `dua i` to get an interface similar to ncdu, and can also run `dua` to list file sizes in the current directory, similar to `du`. Or `dua filename` to get the size of a given file. [0] https://github.com/Byron/dua-cli https://github.com/Byron/dua-cli
- lathiat 4y agoThe UI is not as good but it’s multi threaded and much faster.
- f1refly 4y agoNot in any repo, I'll pass, thanks
- BlackLotus89 4y agoActually it is in the arch community repositories and seems to be quiet a bit faster than ncdu so I will keep it in my toolbox for now. Painpoints are that there seems to be no progress bar in interactive mode, the ui is (imho) ugly/unintuitive (for instance the usage bar seems to be relative? and the shortcuts look like glyphs) and there are functions missing (like exclude patterns, you can exclude dirs though!). So it won't replace ncdu, but if it get a interactive progressbar maybe it will be on all my machines (with arch)
- wereallterrrist 4y agoDiistinctly not true. `nix run github:nixos/nixpkgs/nixos-unstable#dua`
- horlux 4y agoit's in the void and arch repos
- olgeni 4y ago/usr/ports/sysutils/dua-cli
- 0x00101010 4y ago[dead]
- XiS 4y agoBest tool I've ever used for finding where I could free up some disk space
- salmo 4y agoInteresting. I’ve just used df-m | sort -n and walked the tree from the CLI for so long. I’ve also used windirstat (I think that’s what it was called) years ago on Windows and Disk Inventory X on MacOS graphically. This seems like a nice in between that could replace both methods for me. I’ll have to try. The GUI bunch of squares is really only useful when you can hover with a mouse and would be clunky in a TUI even if you could render it. And the FS structure isn’t immediately obvious, so I find myself wasting time wandering hovering over big files and globs of little ones. I really like to avoid a mouse when I can unless it’s really useful.
- lathiat 4y agoFYI I recently discovered sort —-human is a thing so you can keep the K/M/G units if you want to. However I use ncdu all the time.
- salmo 4y agoYeah, my habits come from using GNU, BSD, SysV and having to use the lowest common denominator.
- mandarax8 4y agoYou mean `du` right?
- Sohcahtoa82 4y ago> I’ve also used windirstat (I think that’s what it was called) years ago on Windows and Disk Inventory X on MacOS graphically. On Windows, the new hotness is WizTree, which rather than recursively calling directory listing functions, it directly reads and parses the file tables itself. This makes it orders of magnitude faster. I have a 2 TB hard drive full of a million files, and WizTree reads and parses it all in under a minute, whereas I can expect WinDirStat to take half an hour.
- desro 4y agoI use ncdu almost daily across many different systems. Especially handy when running macOS on a <512GB volume and you need to keep an eye on ballooning caches and other "helpful" cruft. `rmlint` and `jdupes` are also seeing a lot of use here lately, reclaiming terabytes of space from years of sloppy media organization (or the lack thereof!)
- lanstin 4y agoYeah I prune stuff with ncdu weekly on my work 0.5T machine. Oddly I don’t have to use it so much on my 2T personal machine.
- macote 4y agoThe best tool I've used on Windows for that is "Scanner" by Steffen Gerlach: http://www.steffengerlach.de/freeware/ http://www.steffengerlach.de/freeware/
- Farow 4y agoI'm personally a fan of SpaceSniffer: http://www.uderzo.it/main_products/space_sniffer/index.html http://www.uderzo.it/main_products/space_sniffer/index.html
- thecosmicfrog 4y agoI find myself using WinDirStat on Windows systems, but often use ncdu in WSL.
- Sohcahtoa82 4y agoOn Windows, you should switch to WizTree. Rather than recursively calling directory listing functions, it directly reads and parses the file tables itself. This makes it orders of magnitude faster. I have a 2 TB hard drive full of a million files, and WizTree reads and parses it all in under a minute, whereas I can expect WinDirStat to take half an hour. On an SSD, WizTree only takes a couple seconds.
- thecosmicfrog 4y agoThanks for the suggestion!
- user3939382 4y agoIf someone could make a CLI DaisyDisk that would be amazing. If anyone's aware of it let me know please!
- unixhero 4y agoI use this system all the time! ncdu -x to instruct it not to traverse foreign filesystems
- chrisallenlane 4y agoTIL that my `.xsession-errors` file is ~16GB. Thanks, `ncdu`! (I should probably look into this...)
- andrewstuart2 4y ago> This is fine.
- Havoc 4y agoIt's a neat tool. Not quite clear why it's #1 on hn though?
- aftbit 4y agoOne I don't see mentioned here is xdiskusage (for Linux) which gives a nice 20th century style X11 tree view of your disk usage. xdiskusage -qa /
- zoobab 4y agoLove the tool.
- Cieplak 4y agoHave been using ncdu for more than a decade, and recently started using diskonaut for similar purposes. Was looking for a terminal-based treemap visualization for analyzing disk usage and stumbled upon diskonaut, which is exactly that. https://github.com/imsnif/diskonaut https://github.com/imsnif/diskonaut
- ktzar 4y agoncdu is one of the most useful tools I've come across to quickly get rid of unneeded files in remote servers. Top program.
- brazzledazzle 4y agoI use ncdu a lot. It’s not strictly necessary but it’s really nice to have in the toolbox. Also IIRC there is a standalone binary available which comes in handy when you can’t install packages on a full filesystem.
- wjdp 4y agoWhile ncdu does the job I've found gdu (similar tool written in Go) significantly faster for larger directories. https://github.com/dundee/gdu https://github.com/dundee/gdu
- the_gipsy 4y agoSomeone's gotta write rdu.
- arnarbi 4y agoOP’s link has a list at the bottom with alternatives (that in itself is very cool). It lists both gdu and a Rust alternative called dua.
- agleason 4y agoyou're probably more likely to see jsdu first and then I'll have my buddy explaining to me why it's actually faster
- deleted 4y ago[deleted]
- thatwasunusual 4y agoStill only pretty fast, though.
- michaelsbradley 4y agogrowlight may be of interest as well: https://github.com/dankamongmen/growlight#readme https://github.com/dankamongmen/growlight#readme
- topspin 4y agoUsed the zig static build in offline mode yesterday to hunt down a excessive storage consumer. Highly effective. Another tool I've used is jdiskreport[1]. It's a java app with a straightforward GUI. File system scanning is multi-threaded and quite efficient. 1. http://www.jgoodies.com/freeware/jdiskreport/ http://www.jgoodies.com/freeware/jdiskreport/
- luke-stanley 4y agoI have used ncdu for a long time, and it's good if you have time to wait for it to get sizes, if you can't, Duc AKA "Dude, where are my bytes" has caching and is ready to apt install on Debian and Ubuntu repos https://duc.zevv.nl https://duc.zevv.nl and it has different GUI options. It's slightly more complex but for larger volumes I use it instead of ncdu.
- alt227 4y agoThe trick with ncdu is to install it BEFORE your disk gets full from some random error log going haywire.
- cmg 4y agoOne of the first things I did in my new position was to add ncdu (and mysqltuner) to our Ansible playbooks. It's that useful for me - I probably use it every other day at least.
- sdflhasjd 4y ago$ sudo apt install ncdu > Not enough free space Fuck! Actually, one trick I learned was to create a dummy file full of zeroes or rand, maybe 200MB or so, and place it in an obvious location (e.g /) for easy deleting in such a crisis.
- herpderperator 4y agoExt3/ext4 systems do this by default and reserve 5% of space for root.[0] [0] https://docs.cloudera.com/cloudera-manager/7.4.2/managing-clusters/topics/cm-decrease-reserved-space.html https://docs.cloudera.com/cloudera-manager/7.4.2/managing-cl...
- dottedmag 4y agoThat's the reason why typical Linux (or Unix) filesystem comes with a setting to set reserve some space for root account. Doesn't help if the disk is filled by processes running as root, of course.
- ndsipa_pomu 4y agoOr a "journalctl --vacuum-time=1d" will usually clear a lot of space
- banana_giraffe 4y agoI've saved the day once or twice by having a built of ncdu that I can just copy to /dev/shm to figure out what went haywire.
- 4y ago
- WorldPeas 4y agoNCDU is one of the first things I install on any system. Glad it's finally getting some recognition
- LeSaucy 4y agoncdu and /var/lib/docker, name a better combo.
- wereallterrrist 4y ago`docker system prune -af` ?
- jrm4 4y agoBroadly, is anyone aware of a generalized list of "new versions of classic tools?" There are so many now that are better than the old stuff; I almost feel like a unified round up of these, maybe even in a distro form, might be good for linux enthusiasts, newcomers, old-timers, etc.
- pluc 4y agobpytop, ncmpcpp
- capableweb 4y agohttps://github.com/ibraheemdev/modern-unix https://github.com/ibraheemdev/modern-unix > A collection of modern/faster/saner alternatives to common unix commands.
- lillecarl 4y agoZellij instead of tmux (not necessarily better, but it's easier to use) Xonsh instead of bash (because you already know Python, why learn a new horrible language?) bat instead of cat (syntax highlights and other nice things) exa instead of ls (just nicer) neovim instead of vim (just better) helix instead of neovim (just tested it, seems promising though) nix instead of your normal package manager (it works on Mac, and essentially every Linux dist. And it's got superpowers with devshells and home-manager to bring your configuration with you everywhere) rmtrash instead of rm (because you haven't configured btrfs snapshots yet) starship instead of your current prompt (is fast and displays a lot of useful information in a compact way, very customizable) mcfly instead of your current ctrl+r (search history in a nice ncurses tui) dogdns instead of dig (nicer colors, doesn't display useless information) amp, kakoune (more alternative text editors) ripgrep instead of grep (it's just better yo) htop instead of top (displays stuff nicer) gitui/lazygit instead of git cli (at least for staging, nice with file, hunk and line staging when you have ADHD) gron + ripgrep instead of jq when searching through JSON in the shell (so much easier) keychain instead of ssh-agent (better cli imo) Wrote this on the train with my phone by checking https://github.com/Lillecarl/nixos/blob/master/common/default.nix https://github.com/Lillecarl/nixos/blob/master/common/defaul... for which packages I have installed myself :)
- footlose_3815 4y ago[dead]
- HPsquared 4y agoNamed after Enkidu, the ancient Sumerian mythological figure? https://en.m.wikipedia.org/wiki/Enkidu https://en.m.wikipedia.org/wiki/Enkidu
- mhitza 4y agoMost likely just a coincidence due to abbreviating NCurses Disk Usage
- gchamonlive 4y agoDense Edit, to spell it out: op was surely joking
- valdect 4y agoi replaced gnome Baobab with ncdu for a while. it's significantly faster
- fomine3 4y ago`rclone ncdu` is also a jewel
- ghewgill 4y agoYes, this. I actually discovered ncdu through first seeing it in rclone. I thought "that is awesome, why isn't this tool a thing?" And it was. I type `du -sk *|sort -n` a lot less frequently now.
- LeoPanthera 4y agoSee also tkdu for a graphical version: https://github.com/daniel-beck/tkdu https://github.com/daniel-beck/tkdu It's abandoned but it still works, and I like it because you can pipe the output of du into it, which is useful for visualizing remote systems.
- mtooth 4y agoncdu is one of the most useful CLI tools out there! Been using it for many years as well. Another disk scanner worth plugging that I came across for some use cases where I needed to generate single-view reports is pdu - it has the same concurrency implementation that other ncdu alternatives use so the performance is much better too. https://github.com/KSXGitHub/parallel-disk-usage https://github.com/KSXGitHub/parallel-disk-usage
- lasermike026 4y agoOldie but a goodie.
- staunch 4y agoDespite trying these tools many times, I still find myself just running `du -sm * | sort -g`. It works and it's easy to pipe to grep, etc.
- vlowrian 4y agoWow! Someone really outdid himself on todays (7th) advent of code challenge! ;)
- esaym 4y agoI don't really see the point of a gfx ui for this. I just live on the edge: find / -type f -mtime +200 -exec rm -f {} \;
- jstimpfle 4y agodu -hs * | sort -h
- dotancohen 4y agoDo you bump that up to 300 when the Ubuntu release date slips?
- uzername 4y agoI recently discovered ncdu while troubleshooting a logging issue in one of servers. Something broke and syslog began to inflate unchecked and consumed the entire disk's worth of space. ncdu helped explore the system and find out where the file was. Great tool.
- milderworkacc 4y agoI love ncdu and install it on all of my machines. But at the risk of sounding like a broken record - why isn’t its functionality baked into stock file managers on windows and Linux? Why can’t either of these systems do what the Mac has been able to do since the 90s, and display the recursive size of a directory in bytes in the file manager, allowing one to sort directories by recursive size? I am not exaggerating to say this is the single biggest roadblock to my permanent migration to Linux! (I would love nothing more than to hear I’m wrong and “you fool, Dolphin can do that with flag: foo”!)
- jinnko 4y agoranger has this built in
- ShinTakuya 4y agoYeah but I'm not aware of any repos that use it as a stock file manager..
- COGlory 4y agoI'm not sure what exactly you're asking for, but Dolphin shows me the size of a directory. You may have to right click and update it from time to time.
- dotancohen 4y agoThe Bash CLI is my file manager. So I've got ncdu built right in. Try it, you'll love it. I almost never touch the rodent.
- tetris11 4y agoExcept that running "ls" doesn't show you the directory content size, and "ncdu" requires the user to make a tea first. The above poster is right in saying that having this built-in to the filesystem metrics would be a huge win.
- 4y ago
- emmelaich 4y agoFantastic tool. One improvement I'd like to see is support for .Trash instead of straight out deletion. I had to delete a lot of stuff so I turned off the 'Are you sure?' prompt. Sure enough, 4 minutes later I fat fingered some wanted files into oblivion.
- teddyh 4y agoOld-school alternative: du -ax / | xdu -n -c 9
- kqr 4y agoOne thing ncdu does not improve on over du | sort is that it still needs to scan the full directory structure before even displaying any result. I would like something that starts estimating sizes immediately, and then refines those estimations as it is able to spend more time. I tried writing it myself, but I ended up not quite knowing how to go about it, because just getting the count of files in a directory takes about as long as getting the total size of said files... (Another problem is that file sizes are notoriously fat tailed, so any estimation based on a subset of files is likely to underestimate the true size. Maybe by looking at how the estimation grows with more data one can infer something about the tail exponent and use that to de-bias the estimation?)
- bageljr 4y agobtdu
- codetrotter 4y agoThis one? https://github.com/CyberShadow/btdu https://github.com/CyberShadow/btdu Seems to be specific for btrfs
- kqr 4y agoInteresting idea to use physical addresses on the file system as the sample space, though!
- Izkata 4y agoIf you're okay with a GUI, I think that's how baobab works. I think it only shows the intermediate updates if the disk is slow enough, as I remember it doing that in the past, but checking my SSD just now it didn't.
- kqr 4y agoI will take a look. Thanks!
- progman32 4y agoI use this tool all the time! On my Windows boxes, I use an old tool called "Scanner" that presents the results in an interactive pie chart: http://steffengerlach.de/freeware/ http://steffengerlach.de/freeware/ I've used it on everything from Windows 10 to my Win98SE oldschool gaming box.
- shellfishgene 4y agoFor Windows/ NTFS WizTree is unbeatable because of its speed. I wish there was something similar for Linux every time I use it. I don't know anything about dinner systems: why is there nothing so fast for ext3?
- TruthWillHurt 4y agoThe page mentions FSV - a 3d fs viewer. Classic! https://fsv.sourceforge.net/ https://fsv.sourceforge.net/
- bluedino 4y agoWhat do people use on file systems where you have hundreds of TB of files? I always end up having to use the tools that come with the storage device (EMC InsightIQ for example)
- leeoniya 4y agodidnt see my favorite one in "Similar projects": https://github.com/muesli/duf https://github.com/muesli/duf
- jaxrtech 4y agoJust fair warning. 99% of the time, ncdu is great at intuitively finding what is taking up space. Know that unlinked, but in-use files still take up "physical" disk space. Be weary on machines that have not been restarted I'm a while. The free space reported on the file system layer may not be the same as the amount of space taken up by files. i.e. It's possible that delete files may still be referenced by processes still running since the space will not be reclaimed until they are killed or close the fd. This commonly happens with GB of log files you deleted but at still `open()`. That seems to be the greatest difference between Windows and Linux from an OS & file system perspective. - Windows treats files similar to a row in adl database with locking behavior: "This file entry must be deleted from the system. Tell me if I'd be locked out by another process". - Linux treats files as reference counted resources: "I no longer need this file in this directory. The underlying data can still be referenced. You can unlink it."
- hbogert 4y agoI just used it like 10 minutes ago! Awesome piece of tech.