userdel(8) on Solnix vs Linux and the BSDs

On Solnix, userdel is the illumos userdel at /usr/sbin/userdel. It takes only -r and a login name. Linux adds -f, -R, -P and -Z, and NetBSD adds -D, -p, -S and -v. Solnix documents specific exit codes (6, 8, 10, 12), while NetBSD documents only 0 and >0.

What Solnix runs

A default Solnix system runs the illumos userdel at /usr/sbin/userdel. No other variants are shipped. The page is published by pkgs.solnix.illumos-world-man. The related account commands are useradd(8), usermod(8), roledel(8) and logins(8).

Differences

Compared withTopicWhat differs
Linux-f force removalLinux userdel -f forces removal and skips safety checks, including deleting the user's group when it is otherwise kept. The Solnix synopsis is userdel [-r] login and has no -f. A Solnix account that is in use cannot be removed with this command.
Source: Linux userdel(8) -f, --force, CAVEATS; Solnix userdel(8) SYNOPSIS, EXIT STATUS 8
Linuxaccounts with running processesLinux userdel refuses to remove an account that has running processes unless -f is given. Solnix exits 8 when the account is in use. The Solnix page does not say how 'in use' is determined.
Source: Linux userdel(8) CAVEATS; Solnix userdel(8) EXIT STATUS 8
Linux-r and the mail spoolLinux -r removes the home directory and the user's mail spool (MAIL_DIR in login.defs). Solnix -r is documented to remove the home directory only, and the home directory must exist.
Source: Linux userdel(8) -r, --remove; Solnix userdel(8) -r
Linux, NetBSD-r on a missing home directorySolnix -r requires that the home directory exist, and exit status 12 means it could not be removed or modified. The Linux and NetBSD pages do not state this requirement.
Source: Solnix userdel(8) -r, EXIT STATUS 12; Linux userdel(8) -r; NetBSD userdel(8) -r
all fourZFS home directoriesOn Solnix, -r destroys the ZFS file system if the home directory is on its own ZFS file system and /etc/default/useradd sets MANAGE_ZFS=YES. The Linux and NetBSD pages describe nothing like this. No FreeBSD or OpenBSD page is in the bundle.
Source: Solnix userdel(8) -r; Linux userdel(8) -r; NetBSD userdel(8) -r
Linuxalternate root and prefixLinux has -R (chroot directory) and -P (prefix directory) to operate on another tree. Solnix userdel has no equivalent option.
Source: Linux userdel(8) -R, --root, -P, --prefix; Solnix userdel(8) SYNOPSIS
LinuxSELinux mappingLinux -Z removes the SELinux user mapping. Solnix has no -Z. It updates /etc/user_attr, which holds extended user attributes.
Source: Linux userdel(8) -Z; Solnix userdel(8) NOTES, EXIT STATUS 10
NetBSDpreserving the account (-p)NetBSD -p keeps the passwd entry but sets an impossible password and the nologin(8) shell, so files stay attributed to the user. Solnix has no -p. userdel there removes the account definition.
Source: NetBSD userdel(8) -p; Solnix userdel(8) SYNOPSIS, DESCRIPTION
NetBSDdefaults file and -DNetBSD reads defaults from /etc/usermgmt.conf and -D shows or sets them (when built with EXTENSIONS). The Solnix userdel page names no defaults file for userdel itself. It mentions /etc/default/useradd only for MANAGE_ZFS with -r.
Source: NetBSD userdel(8) DESCRIPTION, -D; Solnix userdel(8) -r
NetBSD-S and -vNetBSD -S allows deleting a samba user name (trailing dollar sign) and -v is verbose. Both are available only when built with EXTENSIONS. Solnix has neither option.
Source: NetBSD userdel(8) -S, -v; Solnix userdel(8) SYNOPSIS
Linux, NetBSDexit statusSolnix documents 0, 2 (bad syntax), 6 (no such account), 8 (in use), 10 (group or user_attr not updated but passwd entry removed) and 12 (home directory failure). NetBSD documents 0 and >0 only. The Linux page has no EXIT STATUS section in the bundle.
Source: Solnix userdel(8) EXIT STATUS; NetBSD userdel(8) EXIT STATUS; Linux userdel(8)
Linux, NetBSDfiles updated and name servicesSolnix userdel changes only local /etc/group, /etc/passwd, /etc/shadow and /etc/user_attr, and cannot change data from a network name service. NetBSD updates the user database with pwd_mkdb(8), run in the background. Linux cannot remove NIS attributes on a NIS client.
Source: Solnix userdel(8) NOTES; NetBSD userdel(8) DESCRIPTION; Linux userdel(8) CAVEATS

Standards

  • POSIX: userdel is not a POSIX.1-2024 utility.
  • Solnix: The userdel page in the bundle has no STANDARDS, ATTRIBUTES or standards(7) section.

Writing portable scripts

  • Use only 'userdel -r login' in portable scripts, and check that the account exists first. Exit codes differ: Solnix uses 6 for a missing account, NetBSD documents only >0.
  • Do not rely on -f, -p, -R or -Z. They exist on only one system each. Scripts that need to delete users who are logged in must kill their processes first.

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.