Selectively Checking Disk Usage Excluding Files and Folders

Normally to check the disk usage of directories on a linux system I would run:

du -sh *

However, occasionally I want to exclude particular directories that take a long time to check and/or that I am not interested in anyway. The example below run from the root of the filesystem skips checks for /home /local /var & /mnt giving me the results I needed:

du -sh --exclude='home*' --exclude='local*' --exclude='var*' --exclude='mnt*'   *

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>