zdiff(1) on Solnix vs Linux and the BSDs
zdiff is not in the Solnix base system. Install pkgs.solnix.gzip to get the gzip-project zdiff and zcmp, which are the same program as on Linux. The FreeBSD, OpenBSD and NetBSD versions choose decompression by file extension, and the Solnix and Linux pages do not describe that.
The manual pages
What Solnix runs
Not installed by default: add pkgs.solnix.gzip. The bundle shows no other illumos variant of zdiff or zcmp.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | same program | The Solnix and Linux zdiff pages are word-for-word the same apart from line wrapping. Both describe the gzip package's zcmp and zdiff, which pass all options to cmp or diff and preserve their exit status. Source: Solnix zdiff(1) DESCRIPTION; Linux zdiff(1) DESCRIPTION |
| FreeBSD, OpenBSD, NetBSD | how the compression format is chosen | The BSD pages say zcmp and zdiff rely solely on the file extension to decide whether a file is compressed. The Solnix page says only that files are 'compressed via gzip' and does not say how they are detected. Source: FreeBSD/OpenBSD/NetBSD zdiff(1) CAVEATS; Solnix zdiff(1) DESCRIPTION |
| FreeBSD, NetBSD | bzip2 and xz formats | FreeBSD and NetBSD zdiff handle gzip, bzip2 and xz extensions (e.g. bz2, xz, lzma, txz). The Solnix page mentions only gzip-compressed files, so do not rely on bzip2 or xz input. Source: FreeBSD/NetBSD zdiff(1) DESCRIPTION extension lists; Solnix zdiff(1) DESCRIPTION |
| OpenBSD | supported formats | OpenBSD zdiff supports compress(1) and gzip(1) formats, usually with a Z or gz extension. The Solnix page names only gzip. Source: OpenBSD zdiff(1) DESCRIPTION; Solnix zdiff(1) DESCRIPTION |
| FreeBSD, OpenBSD, NetBSD | single-file form | With one argument, the BSD tools compare file1 with a file of the same name with the extension removed. Solnix compares file1 with the uncompressed contents of file1.gz. Source: FreeBSD/OpenBSD/NetBSD zdiff(1) DESCRIPTION; Solnix zdiff(1) DESCRIPTION |
| FreeBSD, OpenBSD, NetBSD | standard input and special files | The BSD pages say directories, device special files and '-' for standard input are not supported as arguments. The Solnix page lists no such restriction, but its BUGS section says messages may show '-' in place of the real file names. Source: FreeBSD/OpenBSD/NetBSD zdiff(1) CAVEATS; Solnix zdiff(1) BUGS |
| FreeBSD, OpenBSD, NetBSD | TMPDIR | The BSD pages document TMPDIR as the directory for temporary files, defaulting to /tmp. The Solnix page documents no environment variables. Source: FreeBSD/OpenBSD/NetBSD zdiff(1) ENVIRONMENT; Solnix zdiff(1) (no ENVIRONMENT section) |
| FreeBSD, OpenBSD, NetBSD | exit status | The Solnix page says the exit status from cmp or diff is preserved. The BSD pages do not say what exit status zdiff returns. Source: Solnix zdiff(1) DESCRIPTION; FreeBSD/OpenBSD/NetBSD zdiff(1) DESCRIPTION |
Standards
- POSIX: zdiff is not a POSIX.1-2024 utility.
Writing portable scripts
- Pass zdiff real file names with a gz extension. Avoid '-' for standard input, since the BSD pages do not support it.
- Do not rely on bzip2 or xz input with zdiff. Decompress those files first (for example with bzip2(1) or xz(1)) and run diff(1).
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.