May 2017
Beginner
552 pages
28h 47m
English
The --exclude and -exclude-from options cause du to exclude files from the disk usage calculation.
$ du --exclude "WILDCARD" DIRECTORY
Consider this example:
# Excludes all .txt files from calculation
$ du --exclude "*.txt" *
# Exclude temp.txt from calculation
$ du --exclude "temp.txt" *
$ ls *.txt >EXCLUDE.txt
$ ls *.odt >>EXCLUDE.txt
# EXCLUDE.txt contains a list of all .txt and .odt files.
$ du --exclude-from EXCLUDE.txt ...Read now
Unlock full access