← 返回命令列表

Linux command

zcmp 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Compare compressed files

zcmp [file1.gz] [file2.gz]

Show differences

zcmp -l [file1.gz] [file2.gz]

Silent mode

zcmp -s [file1.gz] [file2.gz]

说明

zcmp compares gzip-compressed files byte-by-byte without requiring manual decompression. It invokes cmp on uncompressed contents and passes all supplied options directly to it. 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, 2 on error. 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.

参数

-b, --print-bytes
Print differing bytes (as octal values).
-l, --verbose
Output byte numbers and differing byte values for all differences.
-s, --quiet, --silent
Suppress all output; communicate result only via exit status.
-i _SKIP_, --ignore-initial=_SKIP_
Skip the first _SKIP_ bytes of each (decompressed) input.
-n _LIMIT_, --bytes=_LIMIT_
Compare at most _LIMIT_ bytes.

FAQ

What is the zcmp command used for?

zcmp compares gzip-compressed files byte-by-byte without requiring manual decompression. It invokes cmp on uncompressed contents and passes all supplied options directly to it. 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, 2 on error. 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.

How do I run a basic zcmp example?

Run `zcmp [file1.gz] [file2.gz]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -b, --print-bytes do in zcmp?

Print differing bytes (as octal values).