Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Something along the lines of tar --blacklist='foo.bar foo.baz' -czvf foo.tar.gz ./*

such that any files named foo.bar or foo.baz in the current directory or subdirectories would be ignored?

share|improve this question
up vote 1 down vote accepted

--exclude:

--exclude=PATTERN

exclude files, given as a PATTERN

Also relevant:

--no-anchored

patterns match after any `/' (default for exclusion)

(taken from tar(1) man page)

share|improve this answer

Next time, please try doing some research before asking here.

$ man tar | grep -A 2 exclude


--exclude=PATTERN
       exclude files, given as a PATTERN

 --exclude-backups
       exclude backup and lock files

 --exclude-caches
       exclude contents of directories containing CACHEDIR.TAG,

 --exclude-caches-all
       exclude directories containing CACHEDIR.TAG

 --exclude-caches-under
       exclude everything under directories containing
       CACHEDIR.TAG

 --exclude-tag=FILE
       exclude contents of directories containing FILE, except

 --exclude-tag-all=FILE
       exclude directories containing FILE

 --exclude-tag-under=FILE
       exclude everything under directories containing FILE

 --exclude-vcs
       exclude version control system directories

 -X, --exclude-from FILE
       exclude patterns listed in FILE
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .