-1

It' easy to find out in which file system a given directory is:

$ cd /boot
$ df -h
File System                     Size    Used  Avail      Mountpoint
/dev/sda1                        28G     14G   13G   52% /

Oops, / is fuller than expected.

But the usual suspect is relatively tame today:

$ du -sh /boot
124M    /boot

So what else is consuming 14G?

Is there a simple way to find out what other directories consume space in that filesystem?


Regarding the "possible duplicate": The typical application of the disk space analyzer type most other questions are after will exacly not answer my question, because it will just recurse thru all the subfolders of / in my case and exactly leave out the information I look for.

5
  • No. I am not searching for disk consumptions of files and folders but for folders in a certain mountpoint.
    – flaschbier
    Jun 5, 2017 at 5:31
  • @KamilMaciorowski Please make your pointer to ncdu an answer and explain the -x so I can accept it.
    – flaschbier
    Jun 5, 2017 at 5:56
  • du 'whatever options} | sort -n gives the answer. On Linux, "filelight" si a great utility of this (like ncdu, but prettier, and will also work on remote FS thru SSH).
    – xenoid
    Jun 5, 2017 at 9:06
  • @xenoid Not really, but try du -h -d 1 | sort -h. Little stroke for a character, but huge step for sorting.
    – flaschbier
    Jun 5, 2017 at 9:47
  • Still stand with my options: 1) I just want to see the biggest ones anyway, I don't care if the answer is GB or bytes and 2) -d 1 remains on the surface of things, if your culprit is just a big log file 3 levels down, you'll have to repeat your command at each level to locate it.
    – xenoid
    Jun 5, 2017 at 10:53

1 Answer 1

2

Use

du -x mountpoint

or

ncdu -x mountpoint

The -x option tells both tools not to cross filesystem boundaries. In most cases you will need sudo. The latter command offers you a quite convenient interactive interface; but the former should be available out of the box on many systems.

2
  • thanks :) This solves my current issue. But what to do when I cannot install additional software?
    – flaschbier
    Jun 5, 2017 at 6:00
  • sudo du -xh -d 1 / works great for the original question!
    – flaschbier
    Jun 5, 2017 at 6:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .