diskus icon indicating copy to clipboard operation
diskus copied to clipboard

Provide a way to show size of sub-elements of a given folder

Open jonhoo opened this issue 6 years ago • 9 comments

One of the most common use-cases for du -hs by far for me (and also what dust caters to), is to do du -hs * to find the largest directories in a given directory (usually the current one). It doesn't seem like diskus can currently operate in that mode? It'd be awesome if that kind of "tell me what's large" quick-n-dirty mode could be supported somehow!

jonhoo avatar Nov 01 '18 20:11 jonhoo

I was not planning to turn this into a full-blown replacement for du, but that is indeed also my most common use-case.

What about changing the usage to

diskus [path]...

where diskus would just show the total size of the current directory, but diskus path1 path2 would show the total size for each path? The latter could simply be used with diskus *.

sharkdp avatar Nov 01 '18 21:11 sharkdp

That seems perfect! I think it'd also be handy for the resulting list to be sorted by size, not by the order of the arguments, but with that that's pretty much all I'd need!

jonhoo avatar Nov 01 '18 21:11 jonhoo

Could just pipe it through sort.

polyzen avatar Nov 01 '18 22:11 polyzen

@polyzen yup, you can always do that, but I'd argue that since it's by far the most common use-case, it seems reasonable for that to be the default :) That is also what dust does.

jonhoo avatar Nov 01 '18 22:11 jonhoo

I usually use du -sch * which lists the size of each file/folder and the total size of all combined. This would be really useful to have.

kpcyrd avatar Jan 22 '19 18:01 kpcyrd

I tend to use du -h -d 1 over du -sh * for this, because it only lists directories.

It is sometimes nice to use a greater depth, like when trying to track down an unknown, particularly large subdirectory. So, at the risk of feature creep, it'd be nice to have summaries of arbitrary depth.

joeshaw avatar Feb 12 '19 19:02 joeshaw

My main use case is exactly like @kpcyrd and @polyzen: per directory and file, total size of every listed file and output piped to sort -h.

rNoz avatar Mar 03 '19 08:03 rNoz

Hello, was this ever implemented?

mw55309 avatar Aug 24 '20 13:08 mw55309