ed(1) on Solnix vs Linux and the BSDs

On Solnix, ed is the illumos ed at /usr/bin/ed. It takes -s (or the older -), -p string, -x and -C. Unlike GNU ed it has no long options, -E, -G or +line, and unlike NetBSD it has no -E or -S.

What Solnix runs

/usr/bin/ed is the illumos ed. /usr/xpg4/bin/ed and /usr/xpg6/bin/ed are also shipped with the same synopsis. The one difference the bundle documents is that only /usr/xpg6/bin/ed lets either address be omitted around a comma or semicolon (for example ',' means 1,$). /usr/bin/red is a restricted version.

Differences

Compared withTopicWhat differs
Linuxlong options and extra flagsGNU ed accepts long options and flags such as -E, -G, -l, -q, -r, -v, --strip-trailing-cr and --unsafe-names. The Solnix synopsis lists only -s, -, -p, -x and -C, so scripts that use the GNU flags fail on Solnix.
Source: Linux ed(1) OPTIONS; Solnix ed(1) SYNOPSIS
Linuxquiet flagSolnix ed -s (or -) is the only quiet option the synopsis shows. GNU ed has -s/--script, which suppresses byte counts and the '!' prompt, and a separate -q/--quiet, which suppresses diagnostics on stderr. The Solnix text shown here does not describe what -s suppresses.
Source: Linux ed(1) -s, -q; Solnix ed(1) SYNOPSIS
FreeBSD, OpenBSD, NetBSD-s meaningOn FreeBSD, OpenBSD and NetBSD, -s suppresses diagnostics and is meant for scripted input. OpenBSD and NetBSD also accept - as a deprecated synonym. The Solnix synopsis shows -s and - as alternatives, but the trimmed Solnix text does not define either.
Source: FreeBSD ed(1) -s; OpenBSD ed(1) -, -s; NetBSD ed(1) -, -s; Solnix ed(1) SYNOPSIS
Linux, NetBSDextended regular expressionsGNU ed and NetBSD ed have -E for extended regular expressions. Solnix has no -E: the page says Internationalized Basic Regular Expressions are used for all system-supplied locales.
Source: Linux ed(1) -E; NetBSD ed(1) -E; Solnix ed(1) Regular Expressions
NetBSD-S and -xNetBSD -S disables the ! command, for batch jobs such as patch(1). Solnix has no -S. Both Solnix and NetBSD have -x, which the NetBSD page describes as prompting for an encryption key. Solnix also has -C, which NetBSD lacks.
Source: NetBSD ed(1) -S, -x; Solnix ed(1) SYNOPSIS
FreeBSD, OpenBSD-x not availableFreeBSD and OpenBSD ed list only -s and -p (OpenBSD also lists -). They have no -x or -C, which the Solnix synopsis accepts.
Source: FreeBSD ed(1) SYNOPSIS; OpenBSD ed(1) SYNOPSIS; Solnix ed(1) SYNOPSIS
Linux+line argumentGNU ed accepts +line, +/RE or +?RE before the file name to set the starting line. The Solnix synopsis takes only an optional file.
Source: Linux ed(1) DESCRIPTION, SYNOPSIS; Solnix ed(1) SYNOPSIS
all fourrestricted modeSolnix red only allows editing files in the current directory and refuses !shell command. GNU ed documents red as the same. The FreeBSD page says it restricts names starting with '!' or containing '/'. It adds that symlinks in a writable current directory can get around this.
Source: Solnix ed(1) DESCRIPTION (red); Linux ed(1) DESCRIPTION; FreeBSD ed(1) DESCRIPTION
FreeBSDmultibyte charactersThe FreeBSD page says ed does not recognize multibyte characters. The Solnix text in the bundle says only that Internationalized Basic Regular Expressions are used for system-supplied locales.
Source: FreeBSD ed(1) BUGS; Solnix ed(1) Regular Expressions
Linuxexit statusGNU ed documents exit codes 0 to 3 and has -l to exit 0 even when a command fails. The Solnix text in the bundle has no exit status section, so the manual does not say what exit codes ed returns.
Source: Linux ed(1) EXIT STATUS, -l; Solnix ed(1) (no EXIT STATUS in bundle)
OpenBSD, NetBSDinitial current line and unsaved-buffer warningOpenBSD and NetBSD set the current address to the last line when a file is first read. On Solnix, ed prints "?" when e or q would discard unsaved changes, and repeating the command takes effect. The BSD pages shown here do not describe this.
Source: OpenBSD ed(1) LINE ADDRESSING; NetBSD ed(1) LINE ADDRESSING; Solnix ed(1) DESCRIPTION

Standards

  • POSIX: ed is a POSIX.1-2024 utility.

Writing portable scripts

  • In scripts, use only ed -s file (or ed -p string) with commands fed on standard input. Avoid -E, -G, -l, -q, -S, -x and -C, which exist on only some systems.
  • Do not rely on the shell exit code of ed. The manuals disagree on what is documented, and only GNU ed documents its exit codes.

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.