cp(1) on Solnix vs Linux and the BSDs

On Solnix, cp is the illumos cp at /usr/bin/cp. It has no -v, -l, -s or -x and no long options, but it adds -T, -@ and -/. Its -r, -R and -p semantics differ from Linux and the BSDs, and -r defaults to following symlinks.

What Solnix runs

A default Solnix system runs the illumos /usr/bin/cp. /usr/xpg4/bin/cp is also shipped with the same synopsis. The one documented difference is the combination of -p with -@ or -/. /usr/bin/cp fails the copy if the attributes cannot be copied. With /usr/xpg4/bin/cp the last option given decides whether it fails.

Differences

Compared withTopicWhat differs
all fourno -v (verbose)Solnix cp has no -v. Linux, FreeBSD, OpenBSD and NetBSD all document -v to show each file as it is copied. A script that uses cp -v will fail with an option error on Solnix.
Source: Solnix cp(1) SYNOPSIS ([-afinp@/]), OPTIONS; Linux cp(1) -v; FreeBSD cp(1) -v; OpenBSD cp(1) -v; NetBSD cp(1) -v
Linux, FreeBSD, NetBSDno -l, -s, -xSolnix cp does not document -l (hard-link instead of copy), -s (symlink instead of copy) or -x (stay on one file system). Linux and FreeBSD document all three. NetBSD documents -l only. OpenBSD documents none.
Source: Solnix cp(1) OPTIONS; Linux cp(1) -l, -s, -x; FreeBSD cp(1) -l, -s, -x; NetBSD cp(1) -l
all four-r versus -ROn Solnix, -r defaults to -L (follow symlinks) unless -H, -L or -P is given. -R is the same except that pipes are replicated rather than read. FreeBSD -r is a synonym for -RL. Linux treats -R and -r as the same option. OpenBSD and NetBSD discourage -r.
Source: Solnix cp(1) -r, -R; FreeBSD cp(1) COMPATIBILITY; Linux cp(1) -R, -r, --recursive; OpenBSD cp(1) STANDARDS; NetBSD cp(1) COMPATIBILITY
FreeBSD, OpenBSD, NetBSD-H/-L/-P without -RThe Solnix synopsis shows -H, -L and -P with either -r or -R, and the last one given wins. The FreeBSD, OpenBSD and NetBSD pages say -H, -L and -P are ignored unless -R is specified. FreeBSD and OpenBSD make -P the -R default.
Source: Solnix cp(1) SYNOPSIS, OPTIONS; FreeBSD cp(1) DESCRIPTION; OpenBSD cp(1) DESCRIPTION; NetBSD cp(1) DESCRIPTION
Linux-a meaningSolnix -a is -RpP. Linux -a is -dR --preserve=all, which includes hard links, SELinux context and xattrs. The Solnix text for -a does not mention hard links. The BSD pages also define -a as -RpP.
Source: Solnix cp(1) -a; Linux cp(1) -a, -d, ATTR_LIST
all four-p scopeSolnix -p tries to preserve ACL, times, extended attributes, extended system attributes, mode and owner. If it cannot preserve the ACL or extended system attributes, the copy fails. Linux -p is only mode, ownership and timestamps. FreeBSD, OpenBSD and NetBSD also preserve file flags, and the Solnix text does not mention flags.
Source: Solnix cp(1) -p; Linux cp(1) -p; FreeBSD cp(1) -p; OpenBSD cp(1) -p; NetBSD cp(1) -p
all four-@ and -/Solnix has -@ (copy extended attributes) and -/ (also extended system attributes). If they cannot be copied, cp exits non-zero after the remaining operands. No counterpart page documents -@ or -/. Linux uses --preserve=xattr instead.
Source: Solnix cp(1) -@, -/; Linux cp(1) --preserve, ATTR_LIST
all four-T and -tSolnix has -T (treat target as a file, exactly one source), as does Linux. FreeBSD, OpenBSD and NetBSD do not document -T. Solnix has no -t (target directory first), which only Linux documents.
Source: Solnix cp(1) SYNOPSIS, -T; Linux cp(1) -t, -T; FreeBSD/OpenBSD/NetBSD cp(1) SYNOPSIS
all four-n and -i interactionOn Solnix, if both -i and -n are given, only the last one counts, and -f is ignored when -n is given. On FreeBSD, -n overrides earlier -f and -i. On Linux, -i overrides an earlier -n. OpenBSD and NetBSD have no -n.
Source: Solnix cp(1) -n, -i, -f; FreeBSD cp(1) -n, -i, -f; Linux cp(1) -i, -n; OpenBSD/NetBSD cp(1) SYNOPSIS
FreeBSD, OpenBSD-f meaningOn Solnix, -f unlinks the destination only if a file descriptor for it cannot be obtained. FreeBSD and OpenBSD say -f removes each existing destination and creates a new file, regardless of its permissions. Linux and NetBSD retry only on failure, as Solnix does.
Source: Solnix cp(1) -f; FreeBSD cp(1) -f; OpenBSD cp(1) -f; Linux cp(1) -f; NetBSD cp(1) -f
FreeBSD, OpenBSD, NetBSD-i answerSolnix treats an answer as affirmative if it matches the yesexpr of the user's LC_MESSAGES locale. FreeBSD accepts a reply beginning with y or Y. OpenBSD and NetBSD accept a reply beginning with y.
Source: Solnix cp(1) ENVIRONMENT VARIABLES; FreeBSD cp(1) -i; OpenBSD cp(1) -i; NetBSD cp(1) -i
Linuxno backup, update, reflink or long optionsSolnix cp documents none of Linux's --backup/-b, -u/--update, --reflink, --sparse, --parents, -Z or any long option. Linux backup behavior also reads VERSION_CONTROL and SIMPLE_BACKUP_SUFFIX. Solnix lists only LANG, LC_* and NLSPATH.
Source: Linux cp(1) --backup, --update, --reflink, --sparse, --parents, -Z; Solnix cp(1) OPTIONS, ENVIRONMENT VARIABLES

Standards

  • POSIX: cp is a POSIX.1-2024 utility.
  • OpenBSD: The cp utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification. The flags [-av] are extensions to that specification.
  • NetBSD: The cp utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible. The -a and -l flags are non-standard extensions, and -v is an extension to IEEE Std 1003.2 (“POSIX.2”).

Writing portable scripts

  • Use -R, not -r, for recursive copies, and give -H, -L or -P explicitly together with -R. Their defaults and meanings differ between Solnix, FreeBSD, OpenBSD and NetBSD.
  • Do not use -v, -a, -n, -l, -s or -x in portable scripts. Solnix lacks -v, -l, -s and -x, and OpenBSD and NetBSD have no -n. If you need -p, expect different attributes to be preserved.

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.