Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

If I have the following directory:

$ ls -a foo
.  ..  a  #a#  a~  b  b.bkp  c  .git  .hg  .svn

and call:

$ tar zcf foo-no-bkp.tar.gz --exclude-backups foo/

The resulting archive still has backup files (even those considered backup files according to the documentation).

$ tar ztf foo-no-bkp.tar.gz 

I am using GNU tar 1.26 on Ubuntu 12.04. What can be wrong? Should it be considered a bug?

share|improve this question
Add a file called ~a and see whether it ignores that instead. – Alex Chamberlain Oct 2 '12 at 18:32
@Alex the ~a file is included, too. Anyway, I have just seen backup files with a tilde at the end for now... – brandizzi Oct 2 '12 at 19:04
up vote 8 down vote accepted

I believe this is a bug which has been fixed, in July 2011, but probably hasn't made it to your version of tar yet.

v.1.26 is the current version, and was released 19 months ago (i.e. March 2011), but there will be some delay between the upstream patch and Ubuntu pushing out the fix. It looks like upstream haven't released this as a bug fix yet, since the latest 1.26 download is still dated March 2011.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.