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.
The manual pages
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 with | Topic | What differs |
|---|---|---|
| FreeBSD, OpenBSD | -c meaning | Solnix -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 meaning | Solnix -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 meaning | Solnix 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 meaning | Solnix 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 four | default line width | Solnix 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, NetBSD | goal and maximum operands | The 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, NetBSD | lines starting with a dot | Solnix 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, NetBSD | mail header handling | Solnix 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 |
| Linux | GNU-only options | Linux 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 form | Solnix 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 meaning | On 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,-pand-tin portable scripts: they mean different things on Solnix, Linux and the BSDs, or are missing. Plain `fmt-wN` 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.