Exclude Directories for Disk Usage (du)

ncduI sometimes want to omit directories from my disk usage (du -sh *) checks. This includes virtual files systems such as proc / dev and also mounts to other filesystems (data in the example below).
This is what works for me:

du --exclude={proc,sys,dev,data} -sh *

The equals sign appears to be optional and worked both ways for me.
The exclude option can also be used with the more visual and browsable ncdu e.g.:

ncdu --exclude={proc,sys,dev,data}



Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>