Commands for finding out if compressed Linux files are the same

data breach

malware

network threats

AI generated Image

1 shs shs 102181 Nov 22 11:19 2022.gzIf you compare the files with the diff command, it will confirm that the files differ:$ diff 2021.gz 2022.gz Binary files 2021.gz and 2022.gz differWhat the diff command doesn’t tell you (because it examines the files byte by byte) is that the material that was compressed in creating these two files actually is identical. $ zdiff 2021.gz 2022.gz $ $ zcmp 2021.gz 2022.gz $After using gunzip to decompress the files, the resulting files are the same size and can be compared with the diff command to confirm their identical content. $ zcmp 2022.gz 2023.gz /dev/fd/5 - differ: byte 383573, line 6409Wrap-UpThe zdiff and zcmp commands allow you to compare the content of files compressed with gzip.

Source read time: 3 min - networkworld.com

Also offered in: Nederlands

More news for you