← 返回命令列表

Linux command

zdiff 命令

文件

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

常用示例

Compare two compressed files

zdiff [file1.gz] [file2.gz]

Compare in unified format

zdiff -u [file1.gz] [file2.gz]

Compare in context format

zdiff -c [file1.gz] [file2.gz]

Compare side by side

zdiff -y [file1.gz] [file2.gz]

Compare a compressed file

zdiff [file.gz]

说明

zdiff compares gzip-compressed files line-by-line without requiring manual decompression. It works like diff but transparently handles .gz files, decompressing them on the fly before comparing. If only one file is specified, it is compared against the uncompressed contents of the corresponding .gz file. If two files are specified, their contents (uncompressed if necessary) are fed to diff. All standard diff output formats are supported. Any options accepted by diff can be passed through to zdiff. The exit status from diff is preserved. The command is part of the gzip package. For byte-by-byte comparison, use zcmp instead.

参数

-u
Unified output format.
-c
Context output format.
-y
Side-by-side output.
-q
Report only whether files differ.
-i
Ignore case differences.
-w
Ignore all white space.

FAQ

What is the zdiff command used for?

zdiff compares gzip-compressed files line-by-line without requiring manual decompression. It works like diff but transparently handles .gz files, decompressing them on the fly before comparing. If only one file is specified, it is compared against the uncompressed contents of the corresponding .gz file. If two files are specified, their contents (uncompressed if necessary) are fed to diff. All standard diff output formats are supported. Any options accepted by diff can be passed through to zdiff. The exit status from diff is preserved. The command is part of the gzip package. For byte-by-byte comparison, use zcmp instead.

How do I run a basic zdiff example?

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

What does -u do in zdiff?

Unified output format.