zcmp(1) on Solnix vs Linux and the BSDs

zcmp is not in the Solnix base system; it comes from pkgs.solnix.gzip. The Solnix page text in the bundle is empty, so the comparison below rests on the Linux, FreeBSD and NetBSD pages. On those systems zcmp runs cmp on compressed files, but Linux decides what to decompress differently from the BSDs.

What Solnix runs

Not installed by default: add pkgs.solnix.gzip. The Solnix zcmp(1) page in the bundle has no text, so the manual gives no Solnix-specific details. No illumos variants are shipped.

Differences

Compared withTopicWhat differs
Linux, FreeBSD, NetBSDSolnix page contentThe bundle's Solnix zcmp(1) page is empty. Nothing about Solnix options, environment or behaviour can be confirmed from it, so behaviour is assumed to match the gzip package only where the Linux page is the gzip-1.14 page.
Source: Solnix zcmp(1) section is empty; Linux zcmp(1) [gzip-1.14]
FreeBSD, NetBSDsingle-file formWith one argument, Linux compares file1 to the uncompressed contents of file1.gz. FreeBSD and NetBSD compare file1 to the file of the same name with the extension removed.
Source: Linux zcmp(1) DESCRIPTION; FreeBSD zcmp(1) DESCRIPTION; NetBSD zcmp(1) DESCRIPTION
FreeBSD, NetBSDhow compression is detectedFreeBSD and NetBSD rely solely on the file extension to decide whether a file is compressed. The Linux page does not describe how it decides and says only 'uncompressed if necessary'.
Source: FreeBSD zcmp(1) CAVEATS; NetBSD zcmp(1) CAVEATS; Linux zcmp(1) DESCRIPTION
FreeBSD, NetBSDsupported compression formatsFreeBSD and NetBSD list extensions handled by gzip, bzip2 and xz (for example bz2, xz, lzma, tgz). The Linux page speaks only of files compressed via gzip.
Source: FreeBSD zcmp(1) DESCRIPTION (extension lists); NetBSD zcmp(1) DESCRIPTION; Linux zcmp(1) DESCRIPTION
FreeBSD, NetBSDstandard input and special filesFreeBSD and NetBSD do not support directories, device special files or '-' (standard input) as arguments. The Linux page lists no such restriction, but its BUGS section says messages may show '-' instead of the real file name.
Source: FreeBSD zcmp(1) CAVEATS; NetBSD zcmp(1) CAVEATS; Linux zcmp(1) BUGS
FreeBSD, NetBSDTMPDIRFreeBSD and NetBSD document TMPDIR as the directory for temporary files, with /tmp as the default. The Linux page documents no environment variables.
Source: FreeBSD zcmp(1) ENVIRONMENT; NetBSD zcmp(1) ENVIRONMENT; Linux zcmp(1) (no ENVIRONMENT section)
FreeBSD, NetBSDexit statusThe Linux page states that the exit status of cmp or diff is preserved. The FreeBSD and NetBSD pages do not say.
Source: Linux zcmp(1) DESCRIPTION; FreeBSD zcmp(1); NetBSD zcmp(1)
FreeBSD, NetBSDfile names in messagesThe Linux page warns that cmp or diff messages may name '-' instead of the file you gave. The BSD pages have no such note.
Source: Linux zcmp(1) BUGS

Standards

  • POSIX: zcmp is not a POSIX.1-2024 utility.

Writing portable scripts

  • Name compressed files with a standard extension such as .gz so zcmp works on Linux, FreeBSD and NetBSD, and do not pass '-' or directories.
  • Do not rely on zcmp being present on Solnix: it is not in the base system. Install pkgs.solnix.gzip or fall back to decompressing with gzip and running cmp.

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.