ln(1b) on Solnix vs Linux and the BSDs

This page documents /usr/ucb/ln, the BSD-compatibility ln. A default Solnix system puts /usr/bin/ln (illumos) on PATH, not this one. /usr/ucb/ln takes only -f and -s, and its -f means 'allow a super-user hard link to a directory', not 'replace an existing destination' as on Linux and the BSDs.

What Solnix runs

The command on PATH is the illumos /usr/bin/ln. /usr/xpg4/bin/ln and /usr/ucb/ln are also shipped. This page (ln(1b)) describes only /usr/ucb/ln, so the options of /usr/bin/ln and /usr/xpg4/bin/ln are not in this bundle and are not compared here. Call /usr/ucb/ln by full path to get the behaviour below.

Differences

Compared withTopicWhat differs
all four-f meaningIn /usr/ucb/ln, -f forces a hard link to a directory and is available only to the super-user. On Linux, FreeBSD, OpenBSD and NetBSD, -f removes or unlinks an existing destination so the link can be made. A script that uses ln -sf to replace a link does not get that behaviour from this page.
Source: Solnix ln(1b) -f; Linux ln(1) -f; FreeBSD ln(1) -f; OpenBSD ln(1) -f; NetBSD ln(1) -f
Linuxhard-linking directoriesOn Solnix /usr/ucb/ln, the super-user uses -f to hard link a directory. On Linux the option is -d, -F or --directory, and it only lets the superuser attempt the link if the system supports it.
Source: Solnix ln(1b) -f; Linux ln(1) -d, -F, --directory
FreeBSD, OpenBSD, NetBSDhard-linking directoriesFreeBSD and NetBSD say directories may not be hardlinked. OpenBSD says hard links may not normally refer to directories. None of the three documents a flag to force it, unlike Solnix -f.
Source: FreeBSD ln(1) DESCRIPTION; NetBSD ln(1) DESCRIPTION; OpenBSD ln(1) DESCRIPTION; Solnix ln(1b) -f
all fourmissing optionsThe Solnix /usr/ucb/ln synopsis has only -f and -s. It has no -L or -P (hard links to symlinks), -n or -h (do not follow a symlink target), -i, -v or -w. Linux also has -r, -t, -T, -b and -S, which are absent here. The -L and -P options exist on all four counterparts.
Source: Solnix ln(1b) SYNOPSIS and OPTIONS; Linux ln(1) options; FreeBSD ln(1) -L -P -h -i -n -v -w; OpenBSD ln(1) -h -L -n -P; NetBSD ln(1) -L -P -h -i -n -v -w
all fourdirectory form makes symbolic linksThe Solnix page describes the 'pathname... directory' form as making symbolic links in the directory. It does not say what happens without -s. The Linux, FreeBSD, OpenBSD and NetBSD pages describe that form for both hard and symbolic links.
Source: Solnix ln(1b) DESCRIPTION (third paragraph); Linux ln(1) DESCRIPTION; FreeBSD ln(1) DESCRIPTION; OpenBSD ln(1) DESCRIPTION; NetBSD ln(1) DESCRIPTION
Linuxrelative symlinks and self-pointing linksWith a bare basename and a directory as the last argument, Solnix ln -s makes a link that points to itself ('Too many levels of symbolic links'). The page's workaround is a full path or $PWD. Linux has -r/--relative to create links relative to the link location.
Source: Solnix ln(1b) NOTES; Linux ln(1) -r, --relative
Linuxexisting destinations, backups and environmentLinux ln has --backup, -b, -S, -i, and reads SIMPLE_BACKUP_SUFFIX and VERSION_CONTROL. The Solnix page documents no backup or prompt options, no environment variables, and does not say what happens when the destination exists.
Source: Linux ln(1) --backup, -S, -i and backup suffix paragraph; Solnix ln(1b) OPTIONS
OpenBSDexit statusOpenBSD documents that ln exits 0 on success and >0 on error. The Solnix page has no EXIT STATUS section.
Source: OpenBSD ln(1) EXIT STATUS; Solnix ln(1b) (no EXIT STATUS section)
FreeBSDlink commandThe FreeBSD page also documents link source_file target_file. It takes exactly two non-directory arguments and no options. The Solnix ln(1b) page documents no such command.
Source: FreeBSD ln(1) SYNOPSIS and DESCRIPTION; Solnix ln(1b) SYNOPSIS

Standards

  • POSIX: ln is a POSIX.1-2024 utility. The Solnix ln(1b) page has no STANDARDS section and does not say how /usr/ucb/ln relates to it.
  • FreeBSD: The ln utility conforms to IEEE Std 1003.2-1992 (“POSIX.2”). The simplified link command conforms to Version 2 of the Single UNIX Specification (“SUSv2”). -h, -i, -n, -v and -w are non-standard, and -F is a FreeBSD extension.
  • OpenBSD: The ln utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification. The flags [-hn] are extensions to that specification.
  • NetBSD: The ln utility conforms to IEEE Std 1003.2-1992 (“POSIX.2”). -h, -i, -n, -v and -w are non-standard.

Writing portable scripts

  • Use only -s (and no other flags) in portable scripts. Do not rely on -f: /usr/ucb/ln uses it to force directory hard links, while the other systems use it to replace an existing destination.
  • Pass full paths as symlink targets, as the Solnix NOTES advise. With a bare basename and a directory last argument, /usr/ucb/ln -s makes a link that points to itself.

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.