csplit(1) on Solnix vs Linux and the BSDs
On Solnix, csplit is the illumos csplit at /usr/bin/csplit. It has the same four options as the BSDs (-f, -k, -n, -s). Linux (GNU) adds long options, -b, -z, --suppress-matched and a {*} repeat. Solnix also limits the -f prefix so the file name stays within 14 bytes.
The manual pages
- Solnix: csplit(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: csplit(1) coreutils-full-9.11
- FreeBSD: csplit(1) 15.1-RELEASE
- OpenBSD: csplit(1) 8.0
- NetBSD: csplit(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
csplit
What Solnix runs
A default Solnix system runs the illumos csplit at /usr/bin/csplit. No other variants are shipped. The package is pkgs.solnix.illumos-world-man.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | extra GNU options | Linux csplit has -b/--suffix-format, -z/--elide-empty-files, --suppress-matched, and long forms of -f, -k, -n and -s. The Solnix SYNOPSIS lists only -k, -s, -f and -n, so scripts using the GNU extras fail on Solnix.Source: Linux csplit(1) -b, -z, --suppress-matched, --prefix, --keep-files, --digits, --quiet; Solnix csplit(1) SYNOPSIS |
| Linux | {*} repeat | Linux csplit accepts {*} to repeat the previous pattern as many times as possible. The Solnix page documents only {num}, a fixed repeat count. Source: Linux csplit(1) PATTERN {*}; Solnix csplit(1) OPERANDS {num} |
| Linux | file name suffix format | Solnix -n sets the number of decimal digits and nothing else. Linux additionally lets -b give an sprintf format in place of %02d, so suffixes like hex or a trailing extension are not possible on Solnix.Source: Linux csplit(1) -b, --suffix-format; Solnix csplit(1) -n |
| all four | 14-byte file name limit | Solnix -f fails with a diagnostic, and creates no files, if the prefix would make a file name longer than 14 bytes. The Linux, FreeBSD, OpenBSD and NetBSD pages state no such limit.Source: Solnix csplit(1) -f; Linux/FreeBSD/OpenBSD/NetBSD csplit(1) -f |
| FreeBSD, OpenBSD, NetBSD | signal cleanup | FreeBSD, OpenBSD and NetBSD remove already-written files on HUP, INT or TERM unless -k is given. The Solnix page mentions only removal on error, and says nothing about signals.Source: FreeBSD/OpenBSD/NetBSD csplit(1) DESCRIPTION and -k; Solnix csplit(1) -k |
| FreeBSD, OpenBSD, NetBSD | out-of-range split points | The BSD pages say a split before the current line or past the end of the file is an error. Solnix says an error is reported if an operand does not reference a line between the current position and end of file. Solnix also calls zero-line or too-large offset results unspecified. Source: FreeBSD/OpenBSD/NetBSD csplit(1) DESCRIPTION; Solnix csplit(1) OPERANDS /rexp/[offset] |
| FreeBSD, OpenBSD, NetBSD | LINE_MAX input limit | The BSD pages list a BUGS entry: input lines are limited to LINE_MAX (2048) bytes. The Solnix page documents no such limit. Source: FreeBSD/OpenBSD/NetBSD csplit(1) BUGS; Solnix csplit(1) |
| FreeBSD, OpenBSD, NetBSD | environment variables | Solnix lists LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES and NLSPATH. FreeBSD and NetBSD list LANG, LC_ALL, LC_COLLATE and LC_CTYPE. The OpenBSD page has no ENVIRONMENT section. Source: Solnix csplit(1) ENVIRONMENT VARIABLES; FreeBSD/NetBSD csplit(1) ENVIRONMENT; OpenBSD csplit(1) |
| all four | large files | The Solnix page points to largefile(7) for files of 2 Gbyte (2^31 bytes) or more. The counterpart pages say nothing on this. Source: Solnix csplit(1) USAGE; Linux/FreeBSD/OpenBSD/NetBSD csplit(1) |
Standards
- POSIX: csplit is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Standard. CSI: Enabled.
- FreeBSD: The csplit utility conforms to IEEE Std 1003.1-2001 (“POSIX.1”).
- OpenBSD: The csplit utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.
- NetBSD: The csplit utility conforms to IEEE Std 1003.1-2004 (“POSIX.1”).
Writing portable scripts
- Use only
-f,-k,-nand-s, and numeric or /regexp/ and %regexp% patterns with {num}. Avoid-b,-z,--suppress-matched, {*} and long options. - Keep the
-fprefix short so the file name stays within 14 bytes, which Solnix enforces.
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.