fmt(1) on Solnix vs Linux and the BSDs

On Solnix, fmt is the illumos fmt at /usr/bin/fmt. It has only three options: -c, -s and -w. -c and -s mean something different from -c and -s on FreeBSD and OpenBSD, so a script that passes them gets different behaviour on each system.

What Solnix runs

A default Solnix system runs the illumos fmt at /usr/bin/fmt. /usr/ucb/fmt is also shipped, but the bundle does not describe it. The Solnix synopsis is fmt [-cs] [-w width | -width] [inputfile]..., so it has no goal/maximum operands, -p, -t, -u, -m, -n or -d.

Differences

Compared withTopicWhat differs
FreeBSD, OpenBSD-c meaningSolnix -c is crown margin mode: it keeps the indentation of the first two lines of a paragraph. On FreeBSD and OpenBSD, -c centers the text line by line and ignores most other options. NetBSD centers with -C.
Source: Solnix fmt(1) -c; FreeBSD fmt(1) -c; OpenBSD fmt(1) -c; NetBSD fmt(1) -C
FreeBSD, OpenBSD, NetBSD-s meaningSolnix -s splits long lines without joining short ones. On FreeBSD and OpenBSD, -s collapses runs of whitespace inside lines into one space (two at the end of a sentence). The NetBSD synopsis has no -s.
Source: Solnix fmt(1) -s; FreeBSD fmt(1) -s; OpenBSD fmt(1) -s; NetBSD fmt(1) SYNOPSIS
Linux, FreeBSD, OpenBSD-p meaningSolnix has no -p. On Linux, -p STRING reformats only lines that begin with STRING. On FreeBSD and OpenBSD, -p allows indented paragraphs. Solnix never joins lines with different indentation unless -c is given.
Source: Solnix fmt(1) DESCRIPTION (indentation) and SYNOPSIS; Linux fmt(1) -p; FreeBSD fmt(1) -p; OpenBSD fmt(1) -p
Linux, FreeBSD, OpenBSD-t meaningSolnix has no -t. On Linux, -t treats the paragraph's first line as indented differently from its second. On FreeBSD and OpenBSD, -t number sets the tab stop width of the input. The default is 8.
Source: Solnix fmt(1) SYNOPSIS; Linux fmt(1) -t, --tagged-paragraph; FreeBSD fmt(1) -t; OpenBSD fmt(1) -t
all fourdefault line widthSolnix fills to 72 columns by default. Linux defaults to a 75-column maximum with a goal of 93% of width. FreeBSD, OpenBSD and NetBSD use a goal of 65. Their maximum is 75 on NetBSD and goal+10 on FreeBSD and OpenBSD.
Source: Solnix fmt(1) DESCRIPTION (default width is 72); Linux fmt(1) -w, -g; FreeBSD fmt(1) DESCRIPTION; OpenBSD fmt(1) DESCRIPTION; NetBSD fmt(1) DESCRIPTION
FreeBSD, OpenBSD, NetBSDgoal and maximum operandsThe BSD fmt commands accept a goal and an optional maximum as leading operands, for example fmt 72 72. The Solnix synopsis has only file operands, so a numeric operand would be read as an input file name. Use -w width on Solnix.
Source: FreeBSD fmt(1) SYNOPSIS; OpenBSD fmt(1) SYNOPSIS; NetBSD fmt(1) SYNOPSIS; Solnix fmt(1) SYNOPSIS, OPERANDS
FreeBSD, OpenBSD, NetBSDlines starting with a dotSolnix never fills or splits lines beginning with '.' and has no option to change that. FreeBSD and OpenBSD format them with -n. NetBSD formats them in raw mode (-r).
Source: Solnix fmt(1) DESCRIPTION (nroff compatibility); FreeBSD fmt(1) -n; OpenBSD fmt(1) -n; NetBSD fmt(1) -r
FreeBSD, OpenBSD, NetBSDmail header handlingSolnix always leaves a block of contiguous non-blank lines alone if it looks like a mail header whose first line begins with "From". FreeBSD and OpenBSD format mail header lines only when -m is given. NetBSD skips them unless -r is given.
Source: Solnix fmt(1) DESCRIPTION (mail header); FreeBSD fmt(1) -m; OpenBSD fmt(1) -m; NetBSD fmt(1) DESCRIPTION, -r
LinuxGNU-only optionsLinux fmt has long options and -g (goal width), -u (uniform spacing), --help and --version. It also reads standard input when FILE is -. The Solnix page documents none of these.
Source: Linux fmt(1) SYNOPSIS, -g, -u, --help, --version, DESCRIPTION; Solnix fmt(1) SYNOPSIS
Linux, FreeBSD, OpenBSD-width formSolnix accepts -width only for BSD compatibility and warns that it may go away in future releases. Linux (-WIDTH), FreeBSD and OpenBSD document -width as a normal form, so prefer -w width on Solnix.
Source: Solnix fmt(1) NOTES; Linux fmt(1) SYNOPSIS, DESCRIPTION; FreeBSD fmt(1) DESCRIPTION; OpenBSD fmt(1) DESCRIPTION
NetBSD-w and -g meaningOn NetBSD, -w sets the maximum line length and -g sets the goal. On Solnix, -w width fills lines to up to that many columns and there is no goal setting.
Source: NetBSD fmt(1) -g, -w; Solnix fmt(1) -w

Standards

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

Writing portable scripts

  • Avoid -c, -s, -p and -t in portable scripts: they mean different things on Solnix, Linux and the BSDs, or are missing. Plain `fmt -w N` works on Solnix, Linux, FreeBSD and OpenBSD, and as a maximum length on NetBSD.
  • Set the width explicitly. The defaults differ: 72 on Solnix, a 75-column maximum on Linux, and a goal of 65 on the BSDs.

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.