5

I'd like to see my disk usage using ncdu on / but exclude anything in /home/ and /media/. But my command ncdu / --exclude /home/ --exclude /media/ still scans those dirs.

1 Answer 1

4

When you omit the slashes from the paths, it should work:

ncdu / --exclude home --exclude media

the documentation says about --exclude:

   Exclude files that match PATTERN. The files will still be displayed
   by default, but are not counted towards the disk usage statistics.

The pattern is about the name and not about the path.

2
  • thx! So that means if I have subdirs with a certain name that reoccurs in other places they will all be left out since I can not give a path?
    – Felix
    Commented Jul 8, 2020 at 11:05
  • that's how I understand the manpage. I tried it by creating /tmp/home with files in it. Indeed this directory is excluded by ncdu as well.
    – ruud
    Commented Jul 8, 2020 at 11:14

You must log in to answer this question.

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