Sign in

sdiff(1) on Solnix vs Linux and the BSDs

On Solnix, sdiff is the illumos sdiff at /usr/bin/sdiff, which has only four options: -l, -s, -o and -w. Linux and the BSDs all accept more, such as -i, -b, -W, -a, -t, -d and -I, which the Solnix page does not document.

What Solnix runs

A default Solnix system runs the illumos sdiff at /usr/bin/sdiff; no other illumos variants are shipped. The diffutils sdiff is available as sdiff(1) from pkgs.solnix.diffutils, which is not on PATH by default.

Differences

Compared withTopicWhat differs
all fourmissing diff-passthrough optionsSolnix sdiff accepts only -l, -s, -o and -w; it has no -i, -b, -W, -a, -t, -d or -I. Linux and the three BSDs accept all of these, and the BSD pages list them as options passed to diff(1).
Source: illumos sdiff(1) SYNOPSIS; Linux sdiff(1) -i, -b, -W, -a, -t, -d, -I; FreeBSD, OpenBSD and NetBSD sdiff(1) (options passed to diff(1))
Linux, FreeBSDlong optionsSolnix sdiff documents no long options. Linux documents long options such as --width, --suppress-common-lines and --diff-program, and FreeBSD documents long forms such as --left-column, --output and --tabsize.
Source: illumos sdiff(1) SYNOPSIS; Linux sdiff(1) OPTIONS; FreeBSD sdiff(1) OPTIONS
OpenBSD, NetBSDundocumented GNU long optionsOpenBSD says it supports most GNU sdiff long options, though undocumented, and some need GNU diff. NetBSD says it supports all GNU sdiff options. The Solnix page documents none.
Source: OpenBSD sdiff(1) CAVEATS; NetBSD sdiff(1) CAVEATS; illumos sdiff(1) SYNOPSIS
FreeBSD, OpenBSD, NetBSD-o merge commandsSolnix sdiff -o prompts with % and takes l, r, s, v, e, e l, e r, e b and q. The BSD pages give no prompt character, and OpenBSD adds b l and b r to keep both sides.
Source: illumos sdiff(1) -o; FreeBSD sdiff(1) -o; OpenBSD sdiff(1) -o; NetBSD sdiff(1) -o
FreeBSD, OpenBSD, NetBSDeditor selection for -oThe BSD pages say the -o editor comes from VISUAL, then EDITOR, defaulting to vi(1). The Solnix page lists only locale variables (LANG, LC_*) and does not say which editor runs.
Source: FreeBSD, OpenBSD and NetBSD sdiff(1) ENVIRONMENT; illumos sdiff(1) -o, ENVIRONMENT VARIABLES
Linux, OpenBSDexit statusLinux documents exit 0 if the inputs are the same, 1 if different and 2 for trouble; OpenBSD documents 0, 1 and >1 for an error. The Solnix, FreeBSD and NetBSD pages document no exit status.
Source: Linux sdiff(1) DESCRIPTION; OpenBSD sdiff(1) EXIT STATUS; illumos sdiff(1) DESCRIPTION; FreeBSD sdiff(1) DESCRIPTION; NetBSD sdiff(1) DESCRIPTION
Linuxstandard inputLinux sdiff reads standard input when a FILE is '-'. The Solnix page does not mention '-' as a file name.
Source: Linux sdiff(1) DESCRIPTION; illumos sdiff(1) SYNOPSIS
Linuxsame program as the alternativeThe sdiff from pkgs.solnix.diffutils has the same synopsis and options as the Linux diffutils sdiff (diffutils 3.10 against 3.12): it is the same program. The default /usr/bin/sdiff is the illumos one.
Source: Solnix sdiff(1) from pkgs.solnix.diffutils SYNOPSIS, DESCRIPTION; Linux sdiff(1) SYNOPSIS, DESCRIPTION
all four-b meaning on Linux and the BSDsThe BSD pages describe -b as ignoring trailing blank spaces, while Linux -b ignores changes in the amount of white space and has -Z for trailing space. Solnix sdiff has no -b.
Source: FreeBSD, OpenBSD and NetBSD sdiff(1) -b; Linux sdiff(1) -b, -Z; illumos sdiff(1) SYNOPSIS
OpenBSD, NetBSDbinary dataOpenBSD and NetBSD list under BUGS that sdiff may not work with binary data. The Solnix page says nothing about binary input.
Source: OpenBSD and NetBSD sdiff(1) BUGS; illumos sdiff(1) DESCRIPTION, USAGE

Everyday tasks

TaskSolnixLinuxFreeBSDOpenBSDNetBSD
compare two files side by sidesdiff filename1 filename2sdiff file1 file2sdiff file1 file2sdiff file1 file2sdiff file1 file2
compare two files, hiding identical linessdiff -s filename1 filename2sdiff -s file1 file2sdiff -s file1 file2sdiff -s file1 file2sdiff -s file1 file2
merge two files interactively into a new filesdiff -o output filename1 filename2sdiff -o file file1 file2sdiff -o outfile file1 file2sdiff -o outfile file1 file2sdiff -o outfile file1 file2

Standards

  • POSIX: sdiff is not a POSIX.1-2024 utility.
  • Solnix: ATTRIBUTES: CSI is Enabled.

Writing portable scripts

  • For a script that must run on a default Solnix system and on Linux or the BSDs, use only -l, -s, -o and -w, plus two file names.
  • Do not branch on sdiff's exit status on Solnix: its page does not document one.

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.