ln(1) on Solnix vs Linux and the BSDs
On Solnix, ln is the illumos /usr/bin/ln. It has -T like GNU ln, but no -v, -r, -t, -b or -h. Its -n flag is a documented no-op, whereas on Linux and the BSDs -n means "do not follow a symlink target". For hard links to symlinks, /usr/bin/ln links the symlink itself (as Linux does), while the BSDs link the file it points to.
The manual pages
- Solnix: ln(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: ln(1) coreutils-full-9.11
- FreeBSD: ln(1) 15.1-RELEASE
- OpenBSD: ln(1) 8.0
- NetBSD: ln(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
ln
What Solnix runs
A default Solnix system runs the illumos /usr/bin/ln. /usr/xpg4/bin/ln is also shipped, with a synopsis of [-fis] [-L | -P] and -T, so it has no -n. It differs from /usr/bin/ln in how it treats a symlink source when creating a hard link. /usr/ucb/ln is also shipped, but the bundle does not describe it. The Solnix page text is trimmed at the NOTES section.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD, OpenBSD, NetBSD | hard link to a symlink: default | With neither -L nor -P, Solnix /usr/bin/ln acts as -P and hard-links the symlink itself. FreeBSD, OpenBSD and NetBSD default to -L and link the symlink's target. /usr/xpg4/bin/ln on Solnix defaults to -L.Source: Solnix ln(1) DESCRIPTION (/usr/bin/ln, /usr/xpg4/bin/ln); FreeBSD ln(1) -L; OpenBSD ln(1) -L; NetBSD ln(1) -L |
| Linux | hard link to a symlink: default | Linux ln defaults to -P, as Solnix /usr/bin/ln does. /usr/xpg4/bin/ln on Solnix defaults to -L instead. On both Solnix and Linux, -L and -P are ignored when -s is used.Source: Linux ln(1) final paragraph (defaulting to -P); Solnix ln(1) -L, -P, DESCRIPTION /usr/xpg4/bin/ln |
| all four | -n meaning | On Solnix /usr/bin/ln, -n is the default behaviour (diagnostic if target exists, continue) and is silently ignored. On Linux, FreeBSD, OpenBSD and NetBSD, -n means do not follow a symlink target (Linux: treat LINK_NAME as a normal file). It is not in /usr/xpg4/bin/ln.Source: Solnix ln(1) OPTIONS (/usr/bin/ln -n); Linux ln(1) -n; FreeBSD/NetBSD ln(1) -n; OpenBSD ln(1) -n |
| FreeBSD, OpenBSD, NetBSD | -h missing | Solnix ln has no -h. FreeBSD, OpenBSD and NetBSD use -h to avoid following a target that is a symlink, typically with -f to replace a symlink to a directory. On Solnix, use -T to treat the target as a file.Source: Solnix ln(1) SYNOPSIS, -T; FreeBSD ln(1) -h; OpenBSD ln(1) -h; NetBSD ln(1) -h |
| FreeBSD, OpenBSD, NetBSD | -T | Solnix ln has -T, which treats target as a file and needs exactly one source and one target (for example ln -sT amd64 64). The FreeBSD, OpenBSD and NetBSD pages list no -T.Source: Solnix ln(1) -T; FreeBSD/OpenBSD/NetBSD ln(1) SYNOPSIS |
| Linux | -t, -v, -r, backups and long options | Solnix ln has no -t, -v, -r, -b, -S or --long options. It also does not use VERSION_CONTROL or SIMPLE_BACKUP_SUFFIX; its page lists only LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH. GNU scripts using these fail on Solnix.Source: Linux ln(1) -t, -v, -r, -b, -S, backup paragraph; Solnix ln(1) SYNOPSIS, ENVIRONMENT VARIABLES |
| FreeBSD, NetBSD | -v and -w missing | Solnix ln has no -v (show files as processed) and no -w (warn if a symlink's source does not exist). FreeBSD and NetBSD have both. FreeBSD and NetBSD mark -v and -w as non-standard.Source: FreeBSD ln(1) -v, -w, COMPATIBILITY; NetBSD ln(1) -v, -w, COMPATIBILITY; Solnix ln(1) SYNOPSIS |
| Linux, FreeBSD, NetBSD | -F meaning | Solnix ln has no -F. On Linux, -F is a synonym for -d and lets the superuser try to hard-link directories. On FreeBSD and NetBSD, -F with -s removes an existing directory at the target.Source: Linux ln(1) -d, -F; FreeBSD ln(1) -F; NetBSD ln(1) -F; Solnix ln(1) OPTIONS |
| all four | existing target and write-protected target | Without -f, Solnix skips an existing target with a diagnostic and continues. /usr/bin/ln also prompts on stdin when the target's mode forbids writing; -f suppresses this. The other pages do not describe this mode-based prompt.Source: Solnix ln(1) DESCRIPTION (/usr/bin/ln), -f; Linux ln(1) -f; FreeBSD ln(1) -f; OpenBSD ln(1) -f; NetBSD ln(1) -f |
| Linux | hard-linking directories | The Solnix page says hard links may not refer to directories and gives no override. Linux has -d/-F, which lets the superuser attempt it if the system supports it.Source: Solnix ln(1) DESCRIPTION; Linux ln(1) -d, -F, --directory |
| FreeBSD | link command | FreeBSD's page also documents a simplified link command (exactly two non-directory arguments, no options). The Solnix ln page documents no such form. Source: FreeBSD ln(1) SYNOPSIS, DESCRIPTION (last paragraph); Solnix ln(1) SYNOPSIS |
Standards
- POSIX: ln is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Committed.
- 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,-vand-ware non-standard;-Fis 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,-vand-ware non-standard.
Writing portable scripts
- Use only
-s,-f, and-Lor-Pwith an explicit choice. Avoid-n,-h,-T,-vand-rin portable scripts: their meaning varies or they are missing on some systems. - When a hard link must point at a symlink's target (or at the symlink itself), pass
-L(or-P) explicitly. The default differs between/usr/bin/ln,/usr/xpg4/bin/lnand 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.