May 2017
Beginner
552 pages
28h 47m
English
The -exclude [PATTEN] option will exclude files matched by wildcard patterns from being archived.
For example, to exclude all .txt files from archiving use the following command:
$ tar -cf arch.tar * --exclude "*.txt"
It is also possible to exclude a list of files provided in a list file with the -X flag as follows:
$ cat list
filea
fileb
$ tar -cf arch.tar * -X list
Now it excludes filea and fileb from archiving.