Hacker News new | ask | show | jobs
by milderworkacc 1286 days ago
I 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”!)

7 comments

The 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.
Except 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.
But `du -h -d1` does, though, or `tree —-du -h`.
The time to scan with ncdu on directory with massive number of directories and files can be long and you don't get progressive stats.

I made jsdu to get progressive (and recursive) size.

I mostly only use jsdu on a few top levels directories, and use ncdu for the rest or after the stats is cached by jsdu.

You can install jsdu with "sudo npm i -g jsdu" or run it without install with "npx jsdu"

duc!

use a cronjob for `duc index`, then you can use `duc ui` to see the index. it doesn’t immediately update on change so it’s not quite what you’re looking for, but it might be the closest thing.

Wow thank you for that! This whole thread is great - I've been missing a utility like this for ages but never took the time to go hunting for it.
If I ever need to know a directory size, du -sh foo/ is already muscle memory, and if OP needs it often he can alias it.
I assume the restriction is file system related. It's probably not always cheap to calculate the full size of a directory, especially if it's heavily nested.

Windows will tell you the size of a dir in the right click -> properties menu, but it takes a while to calculate for large/complicated directories.

WizTree (https://diskanalyzer.com/) on Windows seem to be faster than other tools I tried.
>Windows will tell you the size of a dir in the right click -> properties menu, but it takes a while to calculate for large/complicated directories.

Caja (and probably Nautilus/other-Nautilus-based managers) does that as well. But although can show it in properties arranging by size doesn't take it in consideration. (Rather it just sorts them by number of items inside.)

Just lie to me a little bit. I wouldn't mind seeing quick cached approximations that assume that I have changed the disk between reboots, or recently just move huge files around (and the OS would know anyway)
> 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

Many file managers can do that, although for obvious reasons it's rather built as a contextual action on a single directory than an always on feature than would slow down the filesystem horribly by accessing it recursively on many levels. On Thunar (XFCE's file manager) for example it's accessible from the contextual menu opened using the right mouse button on a directory name; other file managers would work in a similar way.

I'm sure filesystems could be modified so that any write would automatically update a field referred by the containing directory, so it would quickly propagate to the upper level, but that would imply many more write accesses which for example on SSD media would do more harm than good.

Mac doesn't for me, for a folder it shows size as "--".
Open display settings (CMD + J) and tick “calculate all sizes”. May take a second if you have some huge directories.
You fool, Dolphin's predecessor Konqueror had a directory view embedding the k4dirstat component! There you can sort by subtree percentage, subtree total (bytes) and amount of items, files, subdirs.

This broke some time in the past (KDE really jumped the shark) and is now available as stand-alone applications only: k4dirstat and filelight. The MIME type inode/directory is already associated with those, so you can run them from the context menu of a directory anywhere, including file managers.

I'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.
Almost every district has a tool called "Disk Usage Analyser" that does exactly what you want. Very helpful when you start getting "no space left on device" errors.
ranger has this built in
Yeah but I'm not aware of any repos that use it as a stock file manager..