exclude
Options@FIXME{put in for the editor's/editors' amusement, but should be taken out in the final draft, just in case! : }
Some users find `exclude' options confusing. Here are some common pitfalls:
tar
will always act on file names
listed on the command line, no matter whether or not there is an
exclusion which would otherwise affect them. In the example above, if
you create an archive and exclude files that end with `*.o', but
explicitly name the file `catc.o' after all the options have been
listed, `catc.o' will be included in the archive.
tar
sees wildcard characters like `*'.
If you do not do this, the shell might expand the `*' itself
using files at hand, so tar
might receive a list of files
instead of one pattern, or none at all, making the command somewhat
illegal. This might not correspond to what you want.
For example, write:
$ tar -c -f archive.tar -X '*/tmp/*' directoryrather than:
$ tar -c -f archive.tar -X */tmp/* directory
regexp
syntax, when using exclude options in tar
. If you try to use
regexp
syntax to describe files to be excluded, your command
might fail.
tar
, what is now the
`--exclude-from=file-of-patterns' option was called
`--exclude-pattern' instead. Now,
`--exclude=pattern' applies to patterns listed on the command
line and `--exclude-from=file-of-patterns' applies to
patterns listed in a file.
Go to the first, previous, next, last section, table of contents.