I have two devices /dev/sdc1
and /dev/sdc3
.
/dev/sdc1
is mounted on /
and /dev/sdc3
is mounted on /home
.
The problem is that the device sdc1
is full whereas sdc3
has a lot of spare space. I want to determine where all that space on sdc1
gone (I suspect installed packages. a lot of them).
I tried to use du
(and ncdu
which makes this info more visual) but it calculates size of the whole tree (/home
is nested on /
) and I want to know only what's filling one of my devices. Is there a way to do that?
To clarify: I need some way to calculate usage of a device, not just exclude some subdirectories (which may be applicable in my situation, but I believe it can be more complex than that)
du -hs * | sort -rh
. You can drill it down from there. – Satō Katsura Jun 02 '17 at 11:46du
– Basile Starynkevitch Jun 02 '17 at 12:12| sort
withdu -h
. The-h
allows the unit to vary, so you can end up with a 10tb file/directory in the middle of couple a kb ones. – phemmer Jun 02 '17 at 12:30sort
has a-h
(which @SatoKatsura used) option to sort human readable numbers, exactly for this. – Henrik supports the community Jun 02 '17 at 12:53du -ks * | sort -rn
, but the output is less readable. – Satō Katsura Jun 02 '17 at 13:13