I have two tar archives (compressed or not compressed), and I want to find all differences in the two archives. Both archives contain a complete file system (i.e. when unpacked, would generate directories like /bin
, /home
, /root
, /usr
, /var
, /etc
,... I hope you get the point). I want to have a list of the following:
- New files
- Removed files
- Changed files (content of file, not just size)
- Changed symlinks (both relative and absolute)
- New/removed symlinks
I cannot just unpack those archives and use diff
, as diff will not correctly recognize absolute symlinks (as they would point out of the file system structure of the archive).
Is there another way to compare the content of two tar archives?
git
may be able to handle symlinks, which would give you the ability to usegit diff
. It'd still involve unpacking into a subdir, though.git diff --no-index dir1 dir2
but get anerror: file/directory conflict: dir1/xxx dir2/xxx
.diff <(tar -tf a.tar) <(tar -tf b.tar)
.