Você pode usar a opção --compare
de tar
. De man tar :
tar {--diff|--compare} [--file ARCHIVE] [OPTIONS] [FILE...]
-d, --diff, --compare
Find differences between archive and file system. The
arguments are optional and specify archive members to
compare. If not given, the current working directory
is assumed.
Exemplo de execução com a.txt
, b.txt
, c.txt
e d.txt
in archive.tgz
:
$ tar -df archive.tgz
tar: a.txt: Warning: Cannot stat: No such file or directory
c.txt: Mod time differs
c.txt: Size differs
d.txt: Mod time differs