This lists all files in two backups, sorted by size:
tar tvf backup1.tar.bz2 |sort -k3 -n >backup1_files.txt
tar tvf backup2.tar.bz2 |sort -k3 -n >backup2_files.txt
I'd like to list all files present in backup2.tar.bz2 but not present in backup1.tar.bz2, sorted by size.
How to do this?
NB:
Doing a
diffof these .txt files won't work because the modification dates of some files won't be the same. Thus this question is not a duplicate of Is there a tool to get the lines in one file that are not in another?.Removing
vwould remove the modification dates, but also the filesizes, so it's not an option because it would be impossible to sort them by size.