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

touch(1b) is the BSD-compatibility touch at /usr/ucb/touch. It accepts only -a, -c, -f and -m and sets only the current time. Scripts that use -d, -r, -t or -h will not work with it. The command on PATH is the illumos /usr/bin/touch, which this page does not document.

What Solnix runs

This page documents /usr/ucb/touch, the illumos BSD-compatibility variant, whose synopsis is `/usr/ucb/touch [-acfm] file...`. The default command on PATH is the illumos /usr/bin/touch. The bundle does not include its text, so its options are not compared here. The page's SEE ALSO points to touch(1) for that command.

Differences

Compared withTopicWhat differs
all foursetting an explicit time/usr/ucb/touch has no -d, -r or -t, so it can only set the current time. Linux, FreeBSD, OpenBSD and NetBSD all accept -d, -r and -t to set a specific time or copy one from a reference file.
Source: Solnix touch(1b) SYNOPSIS, OPTIONS; Linux touch(1) -d, -r, -t; FreeBSD touch(1) -d, -r, -t; OpenBSD touch(1) -d, -r, -t; NetBSD touch(1) -d, -r, -t
Linux, FreeBSD, NetBSD-h for symlinks/usr/ucb/touch has no -h, so the page documents no way to change a symlink's own times. Linux, FreeBSD and NetBSD -h act on the link itself. OpenBSD has no -h either.
Source: Solnix touch(1b) OPTIONS; Linux touch(1) -h; FreeBSD touch(1) -h; NetBSD touch(1) -h
Linux, NetBSD-f meaningOn Solnix, -f tries to force the touch despite read and write permissions on the file. On Linux it is ignored, and on NetBSD it has no effect and is accepted only for compatibility. FreeBSD and OpenBSD list no -f.
Source: Solnix touch(1b) -f; Linux touch(1) -f; NetBSD touch(1) -f; FreeBSD touch(1) SYNOPSIS; OpenBSD touch(1) SYNOPSIS
FreeBSD-A adjustFreeBSD -A adjusts existing timestamps by an offset and implies -c. Solnix /usr/ucb/touch has no equivalent.
Source: FreeBSD touch(1) -A; Solnix touch(1b) OPTIONS
all four-c and exit statusOn Solnix, a nonzero exit is the number of files whose times could not be changed. FreeBSD, OpenBSD and NetBSD say only >0 on error. The Linux page does not describe exit status. The Solnix page does not say whether -c suppresses errors, while the BSD pages say -c leaves the exit value unaffected.
Source: Solnix touch(1b) EXIT STATUS, -c; FreeBSD touch(1) EXIT STATUS, -c; OpenBSD touch(1) EXIT STATUS, -c; NetBSD touch(1) -c
FreeBSD, OpenBSDobsolescent time-as-first-argument formFreeBSD and OpenBSD document an obsolescent form: with no -r/-t (OpenBSD: also no -d) and a first argument of 8 or 10 digits, it is read as a time (MMDDhhmm[YY]). The Solnix page does not describe this, so such an argument may be treated as a file name.
Source: FreeBSD touch(1) COMPATIBILITY; OpenBSD touch(1) STANDARDS; Solnix touch(1b) DESCRIPTION
Linux- and --timeLinux touch treats the file name - as standard output and has --time=WORD to choose which time to change. Neither appears on the Solnix page.
Source: Linux touch(1) DESCRIPTION, --time; Solnix touch(1b) OPTIONS
NetBSDextra NetBSD optionsNetBSD adds -D (skip files whose times already match), -R (take times from a symlink itself), and --date and --reference long options. The Solnix page documents none of them.
Source: NetBSD touch(1) SYNOPSIS, -D, -R, --date, --reference; Solnix touch(1b) OPTIONS
all fourlarge filesThe Solnix page refers to largefile(7) for behaviour with files of 2 Gbyte (2^31 bytes) or more. The counterpart pages in the bundle have no such section.
Source: Solnix touch(1b) USAGE

Standards

  • POSIX: touch is a POSIX.1-2024 utility. The /usr/ucb/touch page itself cites no standard.
  • OpenBSD: The touch utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.
  • FreeBSD: The touch utility is expected to be a superset of the IEEE Std 1003.2 (“POSIX.2”) specification.

Writing portable scripts

  • Do not rely on /usr/ucb/touch for anything beyond -a, -c, -f and -m. Use -d, -r or -t only with a touch that documents them, such as /usr/bin/touch, and test it first.
  • Avoid -f and -h in portable scripts. -f is ignored or absent on most systems, and -h is missing on Solnix /usr/ucb/touch and OpenBSD.

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.