LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   tar --compare (https://www.linuxquestions.org/questions/linux-general-1/tar-compare-530880/)

ygloo 02-20-2007 08:16 PM

tar --compare
 
hello,
how to compare contents of archive to directory?

tried this:
tar --compare --file=file.tar dir
tar --compare --file=file.tar dir/

tar: dir: Not found in archive

tar --compare --file=file.tar dir/*

tar: dir/file: Not found in archive
tar: dir/file: Not found in archive
tar: dir/dir: Not found in archive

colucix 02-21-2007 01:59 AM

Usually the --compare (-d) option is used immediately after having created the archive. You just simply do
Code:

tar -dvf file.tar
and the content of the archive will be compared with the directory specified as relative path to the files inside the archive. In other words, you have not to specify a directory - against which to compare - in the command line. Tar itself take care of looking for the relative path of each archived file.

ygloo 02-23-2007 04:21 PM

hello,
Code:

tar -cpf file.tar dir
tar -dvf file.tar

works when file.tar is in directory it was created

to compare when archive is in different location i did:
Code:

tar -dvf file.tar -C /path/to/dir
tux happy!
Code:

  .--.   
  |o_o |
  ||_/ |   
 //  \ \
(|    | ) 
/'\_  _/`\
\___)=(___/



All times are GMT -5. The time now is 09:52 AM.