xzdiff(1) on Solnix vs Linux and the BSDs
xzdiff is not in the Solnix base system; it comes with pkgs.solnix.xz. It runs cmp or diff on the decompressed contents of two files and picks the decompressor from the filename suffix. The FreeBSD counterpart is zdiff, which has a different name and a different set of supported formats.
The manual pages
What Solnix runs
Not installed by default: add pkgs.solnix.xz. The Solnix page is the Tukaani xz page (dated 2024-02-13), the same program as on Linux. The bundle shows no other variants.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | same program | The Solnix and Linux pages describe the same Tukaani xzcmp/xzdiff/lzcmp/lzdiff. The SYNOPSIS, DESCRIPTION and EXIT STATUS are identical in substance. Source: Solnix xzdiff(1) NAME, SYNOPSIS, DESCRIPTION; Linux xzdiff(1) NAME, SYNOPSIS, DESCRIPTION |
| Linux | lzcmp/lzdiff deprecation | The Linux page (xz-5.8.4) marks lzcmp and lzdiff as deprecated and says they will be removed in a future version. The Solnix page says only that they exist for LZMA Utils compatibility. It does not say they are deprecated. Source: Linux xzdiff(1) SYNOPSIS, DESCRIPTION; Solnix xzdiff(1) SYNOPSIS, DESCRIPTION |
| FreeBSD | command names | FreeBSD documents zcmp and zdiff under this page. Solnix and Linux document xzcmp, xzdiff, lzcmp and lzdiff. A script that calls xzdiff will not find it on FreeBSD by that name, based on the page. Source: FreeBSD xzdiff(1) NAME; Solnix xzdiff(1) NAME |
| FreeBSD | how the format is chosen | Solnix xzdiff picks decompressors from the suffix of each file. These can be xz, gzip, bzip2, lzop, zstd or lz4. An unknown suffix is treated as uncompressed or xz-decompressible. FreeBSD zdiff handles only gzip, bzip2 and xz suffixes, and the page lists no lzop, zstd or lz4. Source: Solnix xzdiff(1) DESCRIPTION; FreeBSD xzdiff(1) DESCRIPTION (extension lists) |
| FreeBSD | unknown suffixes | FreeBSD zdiff relies solely on the file extension to decide whether a file is compressed. Solnix xzdiff treats an unknown suffix as uncompressed or xz-compressed. The FreeBSD page does not describe unknown-suffix handling beyond the extension lists. Source: FreeBSD xzdiff(1) CAVEATS; Solnix xzdiff(1) DESCRIPTION |
| FreeBSD | unsupported arguments | FreeBSD lists directories, device special files and "-" (standard input) as unsupported arguments for zcmp/zdiff. The Solnix page lists no such restrictions and does not say how "-" is handled. Source: FreeBSD xzdiff(1) CAVEATS; Solnix xzdiff(1) DESCRIPTION |
| FreeBSD | exit status | Solnix and Linux document that a decompression error gives exit status 2, and otherwise the status of cmp or diff is used. The FreeBSD page has no EXIT STATUS section. Source: Solnix xzdiff(1) EXIT STATUS; Linux xzdiff(1) EXIT STATUS; FreeBSD xzdiff(1) |
| FreeBSD | TMPDIR | FreeBSD documents TMPDIR for temporary files, defaulting to /tmp. The Solnix and Linux pages have no ENVIRONMENT section and do not mention temporary files. Source: FreeBSD xzdiff(1) ENVIRONMENT; Solnix xzdiff(1) |
| Linux, FreeBSD | --help and --version | On Solnix and Linux, options are passed to cmp or diff unless --help or --version is given. The FreeBSD page says all options are passed through and does not mention --help or --version.Source: Solnix xzdiff(1) DESCRIPTION; Linux xzdiff(1) DESCRIPTION; FreeBSD xzdiff(1) DESCRIPTION |
Standards
- POSIX: xzdiff is not a POSIX.1-2024 utility.
Writing portable scripts
- Do not assume xzdiff exists: it is not in the Solnix base system (add pkgs.solnix.xz), and FreeBSD ships zdiff instead.
- To compare files that may be in lzop, zstd or lz4 format, check that your platform's tool supports them. The FreeBSD page lists only gzip, bzip2 and xz suffixes.
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.