This comp.os.linux.misc poster wanted to exclude multiple directories from "du"'s totals. Answers pointed out that he could put the list the files to exclude in another file and use -X filename. Wildcard patterns are allowed in this file, and also can be used with --exclude (quote wildcards):
du -s . --exclude 'b*'
You can also use multiple --excludes:
du -s . --exclude source --exclude old
Don't make the mistake the poster did of using the real path
du -s . --exclude /home/mylogin/old # WRONG!
Older Unixes (SCO OSR5) "du" aren't so flexible, and lack all these nice options. Bsd has a -I that works like Linux's --exclude, including wildcards.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-03-12 Tony Lawrence
Dump may work fine for you a thousand times. But it _will_ fail under the right circumstances. And there is nothing you can do about it. (Linus Torvalds)