diff3(1) on Solnix vs Linux and the BSDs
On Solnix, diff3 is the illumos /usr/bin/diff3, which takes only -e, -x, -E, -X and -3 and has no merge mode. Its exit status 1 means a difference or an error, unlike Linux and FreeBSD diff3, and its page says files over 64 Kbytes do not work.
The manual pages
What Solnix runs
/usr/bin/diff3 is the illumos diff3; no other illumos variants are shipped. diffutils diff3(1) is available from pkgs.solnix.diffutils; it is not on PATH by default.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD, NetBSD | -m merge mode | Solnix diff3 has no -m. Linux, FreeBSD and NetBSD diff3 -m writes the merged file directly. On Solnix you must generate an ed script and run it through ed(1).Source: illumos diff3(1) SYNOPSIS, OPTIONS; Linux diff3(1) -m; FreeBSD diff3(1) -m; NetBSD diff3(1) -m |
| Linux, FreeBSD, NetBSD | -A show-all | Solnix diff3 has no -A. On Linux, FreeBSD and NetBSD, -A outputs all changes and brackets conflicts. Solnix only offers -E and -X for bracketing.Source: illumos diff3(1) SYNOPSIS, OPTIONS; Linux diff3(1) -A; FreeBSD diff3(1) -A; NetBSD diff3(1) -A |
| Linux, FreeBSD, NetBSD | long options and extra flags | Solnix diff3 documents no long options and none of -i, -L, -T, -a or --diff-program. Linux, FreeBSD and NetBSD document all of these.Source: illumos diff3(1) SYNOPSIS; Linux diff3(1) OPTIONS; FreeBSD diff3(1) OPTIONS; NetBSD diff3(1) OPTIONS |
| OpenBSD | -a on OpenBSD | OpenBSD diff3 has -a (treat all files as ASCII), which the Solnix page does not list; otherwise the two share the -3, -e, -E, -x and -X letters.Source: OpenBSD diff3(1) SYNOPSIS, -a; illumos diff3(1) SYNOPSIS |
| Linux, FreeBSD | exit status | Linux and FreeBSD diff3 exit 0 on success, 1 on conflicts and 2 on trouble. Solnix exits 1 for a difference or a fatal error and above 1 for a fatal error, and says its values differ from diff(1) and other vendors' diff3. Source: illumos diff3(1) EXIT STATUS; Linux diff3(1) DESCRIPTION (last paragraph); FreeBSD diff3(1) DESCRIPTION (last paragraph) |
| all four | 64 Kbyte file limit | The Solnix page says files longer than 64 Kbytes do not work. None of the Linux, FreeBSD, OpenBSD or NetBSD pages states such a limit. Source: illumos diff3(1) NOTES; Linux, FreeBSD, OpenBSD and NetBSD diff3(1) DESCRIPTION |
| Linux, FreeBSD, NetBSD | ed scripts and -i | The Solnix page applies an ed script by appending a command to it before piping it into ed(1). Linux, FreeBSD and NetBSD diff3 have -i to append the w and q commands to the script.Source: illumos diff3(1) DESCRIPTION (ed example); Linux diff3(1) -i; FreeBSD diff3(1) -i; NetBSD diff3(1) -i |
| Linux, FreeBSD, NetBSD | standard input | Linux, FreeBSD and NetBSD pages say a FILE of - reads standard input. The Solnix page does not say whether - is supported. Source: Linux diff3(1) DESCRIPTION (last paragraph); FreeBSD diff3(1) DESCRIPTION; NetBSD diff3(1) DESCRIPTION; illumos diff3(1) SYNOPSIS, DESCRIPTION |
| OpenBSD | TMPDIR | OpenBSD diff3 uses TMPDIR as its temporary directory. The Solnix page has no ENVIRONMENT section. Source: OpenBSD diff3(1) ENVIRONMENT; illumos diff3(1) (no ENVIRONMENT section) |
| Linux | same program as the diffutils alternative | The diff3 from pkgs.solnix.diffutils has the same synopsis and options as the Linux diff3 page (diffutils 3.10 against 3.12): it is the same program. The default /usr/bin/diff3 is the illumos one.Source: Solnix diff3(1) from pkgs.solnix.diffutils SYNOPSIS, OPTIONS; Linux diff3(1) SYNOPSIS, OPTIONS |
Everyday tasks
| Task | Solnix | Linux | FreeBSD | OpenBSD | NetBSD |
|---|---|---|---|---|---|
| compare three files | diff3 filename1 filename2 filename3 | diff3 myfile oldfile yourfile | diff3 myfile oldfile yourfile | diff3 file1 file2 file3 | diff3 myfile oldfile yourfile |
| output an ed script of the changes | diff3 -e filename1 filename2 filename3 | diff3 -e myfile oldfile yourfile | diff3 -e myfile oldfile yourfile | diff3 -e file1 file2 file3 | diff3 -e myfile oldfile yourfile |
| ed script, overlapping changes bracketed | diff3 -E filename1 filename2 filename3 | diff3 -E myfile oldfile yourfile | diff3 -E myfile oldfile yourfile | diff3 -E file1 file2 file3 | diff3 -E myfile oldfile yourfile |
| ed script of only overlapping changes | diff3 -x filename1 filename2 filename3 | diff3 -x myfile oldfile yourfile | diff3 -x myfile oldfile yourfile | diff3 -x file1 file2 file3 | diff3 -x myfile oldfile yourfile |
| ed script of only nonoverlapping changes | diff3 -3 filename1 filename2 filename3 | diff3 -3 myfile oldfile yourfile | diff3 -3 myfile oldfile yourfile | diff3 -3 file1 file2 file3 | diff3 -3 myfile oldfile yourfile |
Standards
- POSIX: diff3 is not a POSIX.1-2024 utility.
- Solnix: ATTRIBUTES: CSI is Enabled.
Writing portable scripts
- Use only
-e,-E,-x,-Xand-3with three file arguments if the script must run on Solnix's default diff3. Do not use-m,-A,-Lor long options. - Do not rely on the diff3 exit status to detect conflicts: Solnix returns 1 for a difference or an error, while Linux and FreeBSD diff3 use 1 for conflicts and 2 for trouble.
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.