LinuxCommandLibrary

zcmp

Compare gzip-compressed files byte-by-byte

TLDR

Compare compressed files

$ zcmp [file1.gz] [file2.gz]
copy
Show differences
$ zcmp -l [file1.gz] [file2.gz]
copy
Silent mode
$ zcmp -s [file1.gz] [file2.gz]
copy

SYNOPSIS

zcmp [-l] [-s] file1 file2

DESCRIPTION

zcmp compares gzip-compressed files byte-by-byte without requiring manual decompression. It works like cmp but transparently handles .gz files, decompressing them on the fly for comparison.
By default, zcmp reports only the first difference found. The -l flag shows all differing byte positions and values. Silent mode (-s) suppresses all output and communicates only through exit codes: 0 if files are identical, 1 if they differ.
The command is part of the gzip package and acts as a convenience wrapper. For line-by-line comparison of compressed files, use zdiff instead.

PARAMETERS

-l

Show byte positions.
-s
Silent, exit code only.
-i SKIP
Skip bytes.

CAVEATS

Gzip format. For .gz files. Part of gzip package.

HISTORY

zcmp is part of the gzip package, providing cmp-like functionality for compressed files.

SEE ALSO

cmp(1), zdiff(1), zcat(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community