Commands for finding out if compressed Linux files are the same
Compressed Linux files are helpful because they save disk space, but what should you do when you have a series of compressed files and want to determine if any are duplicates? The zdiff and zcmp commands can help.
To begin, if a directory contains two files like those below, it’s easy to tell just from the listing that they are not identical. After all, the file sizes are a little different. The files look like this:
$ ls -l total 200 -rw-r--r--. 1 shs shs 102178 Nov 22 2021 2021.gz -rw-r--r--. 1 shs shs 102181 Nov 22 11:19 2022.gz
If you compare the files with the diff command, it will confirm that the files differ: