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.

What Solnix runs

Not installed by default: add pkgs.solnix.gzip. The bundle shows no other illumos variant of zdiff or zcmp.

Differences

Compared withTopicWhat differs
Linuxsame programThe 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, NetBSDhow the compression format is chosenThe 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, NetBSDbzip2 and xz formatsFreeBSD 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
OpenBSDsupported formatsOpenBSD 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, NetBSDsingle-file formWith 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, NetBSDstandard input and special filesThe 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, NetBSDTMPDIRThe 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, NetBSDexit statusThe 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.