rm(1) on Solnix vs Linux and the BSDs
On Solnix, rm is the illumos /usr/bin/rm. It accepts -d, -f, -i, -r, -R and -v, but has no -I, -P, -W or -x and no GNU long options. Its -f/-i handling differs from the others: when standard input is not a terminal, rm acts as if -f were given, and -i always overrides -f whatever the order.
The manual pages
- Solnix: rm(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: rm(1) coreutils-full-9.11
- FreeBSD: rm(1) 15.1-RELEASE
- OpenBSD: rm(1) 8.0
- NetBSD: rm(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
rm
What Solnix runs
A default Solnix system runs the illumos /usr/bin/rm. /usr/xpg4/bin/rm is also shipped, with synopsis [-fiRr]. Its -f does not prompt, writes no diagnostic for non-existent operands and does not change the exit status for them, and it ignores earlier -i. Its -i ignores any -f. The /usr/bin/rm page does not say that -f ignores missing files. The page lists -d and -v as supported by both variants, but the xpg4 synopsis does not show them.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD, OpenBSD, NetBSD | -f and -i precedence | On Solnix /usr/bin/rm, -i overrides -f and stays in effect even when stdin is not a terminal. On FreeBSD, OpenBSD and NetBSD, -f overrides any previous -i and -i overrides any previous -f, so the last one given wins.Source: Solnix rm(1) OPTIONS /usr/bin/rm -i; FreeBSD rm(1) -f, -i; OpenBSD rm(1) -f, -i; NetBSD rm(1) -f, -i |
| all four | stdin not a terminal | Solnix rm runs as if -f were set whenever standard input is not a terminal, so write-protected files are removed without a prompt. The Linux, FreeBSD, OpenBSD and NetBSD pages describe prompting only when stdin is a terminal and do not mention this -f equivalence.Source: Solnix rm(1) DESCRIPTION (last paragraph); Linux rm(1) DESCRIPTION; FreeBSD rm(1) DESCRIPTION; OpenBSD rm(1) DESCRIPTION; NetBSD rm(1) DESCRIPTION |
| all four | -f and non-existent files | Linux, FreeBSD, OpenBSD and NetBSD document -f as ignoring non-existent files, with no diagnostic and no error exit status. The Solnix /usr/bin/rm -f entry does not say this. Only /usr/xpg4/bin/rm -f documents it.Source: Linux rm(1) -f; FreeBSD rm(1) -f; OpenBSD rm(1) -f; NetBSD rm(1) -f; Solnix rm(1) OPTIONS /usr/bin/rm -f and /usr/xpg4/bin/rm -f |
| all four | -d meaning | Solnix -d removes a directory only if it is empty. Linux -d/--dir also removes empty directories. On FreeBSD, OpenBSD and NetBSD, -d attempts to remove directories as well as other files, and -R implies -d.Source: Solnix rm(1) DESCRIPTION, -d; Linux rm(1) -d, --dir; FreeBSD rm(1) -d, -R; OpenBSD rm(1) -d, -R; NetBSD rm(1) -d, -R |
| Linux, FreeBSD | -I | Solnix has no -I. Linux and FreeBSD -I asks once before removing more than three files or removing recursively. OpenBSD and NetBSD have no -I either. On Solnix, -i is the only prompting option.Source: Linux rm(1) -I; FreeBSD rm(1) -I; Solnix rm(1) SYNOPSIS; OpenBSD rm(1) SYNOPSIS; NetBSD rm(1) SYNOPSIS |
| all four | -P overwrite | Solnix has no -P. OpenBSD -P overwrites regular files once with a random pattern. NetBSD -P overwrites three times and refuses to remove a file it cannot overwrite. FreeBSD -P has no effect. Linux has no -P and points to shred(1).Source: OpenBSD rm(1) -P; NetBSD rm(1) -P; FreeBSD rm(1) -P, COMPATIBILITY; Linux rm(1) DESCRIPTION/SEE ALSO shred(1); Solnix rm(1) SYNOPSIS |
| FreeBSD, NetBSD | -W undelete | Solnix has no -W. FreeBSD and NetBSD -W tries to undelete files covered by whiteouts, which are used by union file systems. Passing -W to Solnix rm is an invalid option.Source: FreeBSD rm(1) -W; NetBSD rm(1) -W; Solnix rm(1) SYNOPSIS |
| Linux, FreeBSD, NetBSD | staying on one file system | Solnix has no option to avoid crossing mount points. FreeBSD and NetBSD use -x. Linux uses --one-file-system.Source: FreeBSD rm(1) -x; NetBSD rm(1) -x; Linux rm(1) --one-file-system; Solnix rm(1) OPTIONS |
| Linux | long options and root protection | Linux (GNU) rm has long options (--force, --recursive, --verbose, --interactive[=WHEN]) and --preserve-root, which is the default. The Solnix page lists no long options and says nothing about refusing to remove /.Source: Linux rm(1) --preserve-root, --no-preserve-root, --interactive; Solnix rm(1) SYNOPSIS and OPTIONS |
| FreeBSD, OpenBSD, NetBSD | protected operands | FreeBSD makes removing /, . or .. an error. OpenBSD does so for the root directory, . and ... NetBSD names only . and ... The Solnix page does not list any operands that are refused. Source: FreeBSD rm(1) DESCRIPTION; OpenBSD rm(1) DESCRIPTION; NetBSD rm(1) DESCRIPTION; Solnix rm(1) OPERANDS |
| all four | end-of-options marker | Solnix NOTES describe - as the end-of-options marker, with -- accepted as a BSD migration aid that may disappear. If both appear, the second is a file name. Linux and FreeBSD document rm -- -foo.Source: Solnix rm(1) NOTES; Linux rm(1) DESCRIPTION; FreeBSD rm(1) NOTES |
| FreeBSD | unlink in the same page | The FreeBSD page also covers unlink, a one-argument mode that calls unlink(2). The Solnix rm page documents no unlink command and points to unlink(2) in SEE ALSO. Source: FreeBSD rm(1) NAME, SYNOPSIS; Solnix rm(1) SEE ALSO |
Standards
- POSIX: rm is a POSIX.1-2024 utility.
- Solnix: Interface Stability:
/usr/xpg4/bin/rmis Committed. The page points to standards(7). - OpenBSD: The rm utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification. The flags [
-dPv] are extensions to that specification. - NetBSD: The rm utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible. The
-vand-xoptions are extensions. - FreeBSD: The page says the rm command conforms to (the standard name is missing from the text). unlink conforms to Version 2 of the Single UNIX Specification (“SUSv2”). The page calls
-vnon-standard.
Writing portable scripts
- For portable scripts use only
-f,-iand-r(or-R).-d,-v,-I,-P,-Wand-xare missing or behave differently on at least one system. - Put -- or ./ before file names that may start with a dash. Solnix documents - and -- as end-of-options markers, and Linux and FreeBSD document -- and ./name.
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.