stat(1) on Solnix vs Linux and the BSDs
stat is not in the Solnix base system. The Solnix page is GNU coreutils stat, published by pkgs.solnix.coreutils, and it matches the Linux page. The BSD stat is a different program: -f takes a format string there, while GNU uses -c/--format and -f means file-system status.
The manual pages
What Solnix runs
Not installed by default: add pkgs.solnix.coreutils. The bundle lists no other illumos variant and does not say what the base system provides under this name. The Solnix page is GNU coreutils 9.7 (April 2025).
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | same program | The Solnix and Linux pages describe the same GNU coreutils stat. Options and format sequences are identical in the bundle: -L, -f, -c/--format, --printf, -t, --cached, --help and --version. Only the version differs: Solnix 9.7, Linux coreutils-full-9.11.Source: Solnix stat(1) SYNOPSIS and DESCRIPTION; Linux stat(1) SYNOPSIS and DESCRIPTION |
| FreeBSD, OpenBSD, NetBSD | -f meaning | On Solnix (GNU), -f displays file system status instead of file status. On FreeBSD, OpenBSD and NetBSD, -f format takes a format string. A BSD script using stat -f '%z' file fails or misbehaves under GNU stat.Source: Solnix stat(1) -f, --file-system; FreeBSD/OpenBSD/NetBSD stat(1) -f format |
| FreeBSD, OpenBSD, NetBSD | custom format option | Solnix uses -c FORMAT or --format=FORMAT, and --printf=FORMAT for backslash escapes with no trailing newline. The BSD pages document -f format and no -c or --printf option. The BSD -n suppresses the newline.Source: Solnix stat(1) -c, --format, --printf; FreeBSD/OpenBSD/NetBSD stat(1) SYNOPSIS, -f, -n |
| FreeBSD, OpenBSD, NetBSD | format sequences differ | Solnix format letters are GNU-style: %s is size in bytes, %U is the owner name, %Y is the mtime in epoch seconds, %F is the file type. In the BSD pages, a format is built from optional flags, size, precision, fmt, sub and datum fields, such as %z for size, %Sm for a time string and %Su for the owner name. Source: Solnix stat(1) valid format sequences for files; OpenBSD stat(1) FORMATS (datum z, a/m/c/B); NetBSD stat(1) -s example format |
| FreeBSD, OpenBSD, NetBSD | terse and shell output | Solnix -t/--terse prints a fixed GNU field list: %n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o. On the BSDs, -t takes a strftime(3) time format. -s prints shell variable assignments, and -r prints raw numbers.Source: Solnix stat(1) -t, --terse; FreeBSD/OpenBSD/NetBSD stat(1) -t timefmt, -s, -r |
| FreeBSD, OpenBSD, NetBSD | symlink default and -L | BSD stat uses lstat(2) by default and -L switches to stat(2), falling back to lstat if the target is missing (FreeBSD, NetBSD). The Solnix page documents only -L, --dereference (follow links) and does not say what the default is.Source: FreeBSD/OpenBSD/NetBSD stat(1) DESCRIPTION and -L; Solnix stat(1) -L, --dereference |
| FreeBSD, OpenBSD, NetBSD | human-readable and long output | Solnix has no -l, -x or -F. On the BSDs, -l gives ls -lT format, -x gives a more verbose layout, and -F appends type characters and implies -l. For Solnix, use --format or --terse.Source: FreeBSD/OpenBSD/NetBSD stat(1) -l, -x, -F; Solnix stat(1) SYNOPSIS |
| FreeBSD | FreeBSD-only options and readlink | FreeBSD stat has -H (NFS file handle, needs root) and -h (list sparse file holes). The FreeBSD page also covers readlink, invoked under that name. The Solnix page documents none of these.Source: FreeBSD stat(1) NAME, SYNOPSIS, -H, -h; Solnix stat(1) SYNOPSIS |
| FreeBSD, OpenBSD, NetBSD | no file argument | BSD stat with no file argument shows the file descriptor for standard input, and the file argument is optional. The Solnix synopsis requires FILE... and the page does not describe a stdin default. Source: FreeBSD/OpenBSD/NetBSD stat(1) DESCRIPTION; Solnix stat(1) SYNOPSIS |
| FreeBSD, OpenBSD, NetBSD | remote cache control and SELinux | Solnix has --cached=MODE (always, never, default) and the %C SELinux context sequence. The BSD pages show no such option or field.Source: Solnix stat(1) --cached, %C; FreeBSD/OpenBSD/NetBSD stat(1) SYNOPSIS |
Standards
- POSIX: stat is not a POSIX.1-2024 utility.
Writing portable scripts
- Do not rely on stat
-for-cin a portable script:-fmeans file-system status under GNU and a format string on the BSDs. Detect which stat is present, or use ls or find instead. - On Solnix, stat is not in the base system. Add pkgs.solnix.coreutils before using GNU stat options in a script.
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.