Server Fault is a question and answer site for system and network administrators. 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

I want to compare the content of a tar archive (backup of $HOME) with the content of my local $HOME to see whether there are files in the tar file which are not yet in the local filesystem.

What is the best way to do that?

I tried tar -dvf archive.tar * in $HOME already but the output is not really satisfying. It says tar: Videos: Not found in archive for some files and folders on the first directory level although they are in the archive and then it exits with tar: Exiting with failure status due to previous errors (exit code 2).

EDIT: It's on Ubuntu 10.04 and I'm quite familiar with the bash.

share|improve this question
The problem is you're not using -f so tar isn't using your tar file as input as you're expecting. – Dave Forgac Aug 19 '10 at 16:14
Sorry, i just forgot the options here. I used them. EDITED – dAnjou Aug 19 '10 at 16:36
up vote 7 down vote accepted

Try this:

tar -dvf example.tar

(in the directory with which you're comparing)

The -d is the same as --diff / --compare

More info: and

share|improve this answer
That works great, thanks. – dAnjou Aug 19 '10 at 16:39

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.