touch(1) on Solnix vs Linux and the BSDs
On Solnix, touch is the illumos /usr/bin/touch. It is also published with settime(1), which is touch -c under another name. Its -d accepts only the fixed ISO-style form, and it has no -h for symbolic links, so Linux, FreeBSD and NetBSD scripts that use -h, -A, -R, --date or --time will not work.
The manual pages
- Solnix: touch(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: touch(1) coreutils-full-9.11
- FreeBSD: touch(1) 15.1-RELEASE
- OpenBSD: touch(1) 8.0
- NetBSD: touch(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
touch
What Solnix runs
A default Solnix system runs the illumos touch at /usr/bin/touch. /usr/ucb/touch is also shipped, but the bundle does not describe it. The Solnix page also documents settime, which is equivalent to touch -c [time_spec] file. For settime, -f ref_file names a reference file.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD, NetBSD | -h (symlink itself) | The Solnix touch page has no -h, so there is no documented way to set the times of a symbolic link itself. Linux, FreeBSD and NetBSD accept -h, and on FreeBSD and NetBSD it implies -c.Source: Solnix touch(1) SYNOPSIS/OPTIONS; Linux touch(1) -h; FreeBSD touch(1) -h; NetBSD touch(1) -h |
| Linux, NetBSD | -f | Solnix touch has no -f. Linux (ignored) and NetBSD (no effect, for compatibility) accept it. On Solnix, -f exists only for settime, where it takes ref_file and is not ignored.Source: Solnix touch(1) OPTIONS settime -f ref_file; Linux touch(1) -f; NetBSD touch(1) -f |
| Linux, NetBSD | -d date parsing | Solnix -d takes only YYYY-MM-DDThh:mm:SS[.frac][tz], where T may be a space and tz is empty or Z. NetBSD tries that form first, then falls back to parsedate(3) for human dates. Linux -d parses a STRING; the page gives no grammar.Source: Solnix touch(1) -d date_time; NetBSD touch(1) -d; Linux touch(1) -d, --date |
| FreeBSD, OpenBSD, NetBSD | -t two-digit years | Solnix -t rejects YY of 39-68 as an error and maps 69-99 to 19 and 00-38 to 20. FreeBSD, OpenBSD and NetBSD map 69-99 to 19 and everything else to 20, with no error range.Source: Solnix touch(1) -t time (CC table); FreeBSD touch(1) -t; OpenBSD touch(1) -t; NetBSD touch(1) -t |
| all four | 2038 limit | Solnix states that the valid range is the Epoch to January 18, 2038, and that a time before the Epoch makes touch exit immediately with an error. The Linux, FreeBSD, OpenBSD and NetBSD pages in the bundle state no such range. Source: Solnix touch(1) -t time; Linux/FreeBSD/OpenBSD/NetBSD touch(1) -t |
| FreeBSD | obsolescent time_spec year mapping | Both accept a leading MMDDhhmm[YY] operand. Solnix maps YY 69-99 to 1969-1999 and 00-38 to 2000-2038, with 39-68 an error. FreeBSD maps 39-99 to 1939-1999 and anything else to the 21st century. Source: Solnix touch(1) OPERANDS time_spec; FreeBSD touch(1) COMPATIBILITY |
| Linux | time_spec operand | Solnix and OpenBSD document the old MMDDhhmm[YY] first-operand form, and FreeBSD does too. The Linux page documents no such form, so only -t, -d or -r set an explicit time there.Source: Solnix touch(1) OPERANDS; OpenBSD touch(1) STANDARDS; FreeBSD touch(1) COMPATIBILITY; Linux touch(1) DESCRIPTION |
| all four | exit status | On Solnix, a non-zero exit status is the number of files whose times could not be changed. The Linux page gives no exit status. FreeBSD, OpenBSD and NetBSD say only 0 on success and >0 on error. Source: Solnix touch(1) EXIT STATUS; FreeBSD/OpenBSD/NetBSD touch(1) EXIT STATUS |
| all four | non-owner with write access | On Solnix, a user with write access who is not the owner or a super-user can set only the current time. Trying to set a specific time is an error. The counterpart pages in the bundle do not say. Source: Solnix touch(1) DESCRIPTION; Linux/FreeBSD/OpenBSD/NetBSD touch(1) |
| FreeBSD | -A adjust | FreeBSD -A [-][[hh]mm]SS shifts existing timestamps by an offset and implies -c. Solnix, Linux, OpenBSD and NetBSD pages have no -A.Source: FreeBSD touch(1) -A; Solnix touch(1) SYNOPSIS |
| NetBSD | -D and -R | NetBSD has -D (skip the update if times are already as specified) and -R (take times from a symlink itself when it is the reference). Solnix has neither.Source: NetBSD touch(1) -D, -R; Solnix touch(1) OPTIONS |
| Linux | long options and --time | Linux has --date, --reference, --no-create, --no-dereference and --time=WORD. Solnix touch documents only short options. Linux also treats a FILE of - as standard output; the Solnix page does not say.Source: Linux touch(1) --time, --reference, FILE argument -; Solnix touch(1) SYNOPSIS |
Standards
- POSIX: touch is a POSIX.1-2024 utility.
- 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
- Use only
-a,-c,-m,-rand-tin portable scripts; all five systems document them. Avoid-h,-f,-A,-Dand-R, and the old MMDDhhmm first-operand form. - For
-d, use the fixed YYYY-MM-DDThh:mm:SS form. Solnix accepts nothing else, though FreeBSD, OpenBSD and NetBSD also document it.
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.