cpio(1) on Solnix vs Linux and the BSDs
On Solnix, cpio is the illumos cpio at /usr/bin/cpio. It has only short options, no -0, no -F and no built-in compression. Scripts written for GNU cpio or the libarchive cpio on FreeBSD and NetBSD (find -print0 | cpio -0, -F archive, --format, -J/-z) will fail on it.
The manual pages
What Solnix runs
A default Solnix system runs the illumos cpio at /usr/bin/cpio. No other variants are shipped. The Solnix page text in the bundle is trimmed, so the meanings of some options (-k, -P, -@, -/, -V, -q, -s, -S) and the default header format are not visible here.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD, NetBSD | NUL-separated file names (-0) | Solnix cpio has no -0 or --null in its synopsis, so it cannot read NUL-separated names. Linux, FreeBSD and NetBSD accept -0/--null for names that may contain newlines. OpenBSD has no -0 either.Source: Solnix cpio(1) SYNOPSIS; Linux cpio(1) -0, --null; FreeBSD cpio(1) -0, --null; NetBSD cpio(1) -0, --null |
| all four | archive file option (-F) | Solnix names the archive with -I (read) and -O (write), and has no -F. Linux, FreeBSD, NetBSD and OpenBSD all accept -F to read or write the archive file. FreeBSD and NetBSD also give --file.Source: Solnix cpio(1) SYNOPSIS (-I, -O); Linux cpio(1) -F, --file; FreeBSD cpio(1) -F; NetBSD cpio(1) -F; OpenBSD cpio(1) -F archive |
| Linux, FreeBSD, NetBSD | long options | Solnix cpio has only single-letter options. Linux, FreeBSD and NetBSD cpio also take long options such as --create, --extract, --format, --make-directories and --quiet.Source: Solnix cpio(1) SYNOPSIS; Linux cpio(1) SYNOPSIS; FreeBSD cpio(1) OPTIONS; NetBSD cpio(1) OPTIONS |
| all four | -H format names | Solnix -H accepts bar (read only), crc|CRC, odc, tar|TAR and ustar|USTAR in the visible text, with no newc. Linux accepts bin, odc, newc, crc, tar, ustar, hpbin and hpodc. FreeBSD and NetBSD list cpio, newc, odc, pax and ustar. OpenBSD lists bcpio, cpio, pax, sv4cpio, tar and ustar.Source: Solnix cpio(1) -H header; Linux cpio(1) -H; FreeBSD cpio(1) -H; NetBSD cpio(1) -H; OpenBSD cpio(1) -o -H format |
| FreeBSD, OpenBSD, NetBSD | format named "cpio" | A -H argument of cpio means odc on FreeBSD and NetBSD, and the old octal character format on OpenBSD. The Solnix text has no format called cpio. Its portable ASCII choices are -H odc (IEEE/P1003) and crc.Source: FreeBSD cpio(1) -H (cpio: synonym for odc); NetBSD cpio(1) -H; OpenBSD cpio(1) -H (cpio: old octal character cpio format); Solnix cpio(1) -H header |
| Linux, FreeBSD, NetBSD | -c meaning | On Solnix, -c writes the SVR4 ASCII header with expanded device numbers. For unknown machines the page says to use -H odc instead. On Linux, FreeBSD and NetBSD, -c is the old POSIX portable (odc) format, the same as -H odc or --format odc.Source: Solnix cpio(1) -c; Linux cpio(1) -c; FreeBSD cpio(1) -c; NetBSD cpio(1) -c |
| Linux, OpenBSD | -b meaning | Solnix -b reverses the byte order within each word and works only with -i. Linux -b swaps both halfwords and bytes (equivalent to -sS). OpenBSD -b does byte and word swapping on read. FreeBSD and NetBSD have no -b.Source: Solnix cpio(1) -b; Linux cpio(1) -b, --swap; OpenBSD cpio(1) -i -b; FreeBSD cpio(1) OPTIONS; NetBSD cpio(1) OPTIONS |
| FreeBSD, OpenBSD, NetBSD | compression options | Solnix cpio has no compression options. FreeBSD and NetBSD offer -J, -j, -y, -z, -Z and --lz4, --zstd, --lzma, --lzop and --lrzip. OpenBSD offers -j (bzip2, installed separately), -Z (compress) and -z (gzip).Source: Solnix cpio(1) SYNOPSIS; FreeBSD cpio(1) -J, -j, --lz4, --zstd; NetBSD cpio(1) -J, --lzma; OpenBSD cpio(1) -j, -Z, -z |
| FreeBSD, NetBSD | archive types read and written | FreeBSD and NetBSD cpio use libarchive. They read tar, pax, cpio, zip, jar, ar and ISO 9660 images and write tar, pax, cpio, ar and shar. The Solnix text lists only the -H header formats bar, crc, odc, tar and ustar.Source: FreeBSD cpio(1) DESCRIPTION; NetBSD cpio(1) DESCRIPTION; Solnix cpio(1) -H header |
| FreeBSD, NetBSD | append (-A) | On Solnix, -A appends to an archive, requires -O, and is valid only for archives that are files, floppy diskettes or hard disk partitions. FreeBSD and NetBSD document -A as not yet implemented.Source: Solnix cpio(1) -A; FreeBSD cpio(1) -A; NetBSD cpio(1) -A |
| FreeBSD, NetBSD | restoring ownership | Solnix cpio -i gives files the current user's owner and group unless that user has the {PRIV_FILE_CHOWN_SELF} privilege. FreeBSD and NetBSD restore ownership by default for root (--preserve-owner) and not for other users (--no-preserve-owner).Source: Solnix cpio(1) Copy In Mode; FreeBSD cpio(1) --preserve-owner, --no-preserve-owner; NetBSD cpio(1) --preserve-owner, --no-preserve-owner |
| Linux | -R in copy-out, -n and -D | The Solnix synopsis shows -R only for -i and -p. Linux -R also works in copy-out, where it stores the owner in the archive. Solnix has no -n (numeric uid/gid in a listing) and no -D directory option, which Linux has.Source: Solnix cpio(1) SYNOPSIS; Linux cpio(1) -R, --owner, -n, -D |
Standards
- POSIX: cpio is not a POSIX.1-2024 utility.
- Solnix: The page describes
-Hodc as the IEEE/P1003 Data Interchange Standard cpio header and format, and the official format for transferring files between POSIX-conforming systems (see standards(7)). - Linux:
-Hodc is described as the old (POSIX.1) portable format. - FreeBSD: odc is described as the old POSIX.1 portable octet-oriented cpio format; ustar as the POSIX.1 tar format.
Writing portable scripts
- Use
-Hodc when the archive must be read on Solnix, Linux, FreeBSD and NetBSD. Do not use-Hnewc or-Hbar: the visible Solnix text has no newc, and bar is read-only. - Do not use
-0,-F, long options or compression flags in a portable script. Feed names on stdin separated by newlines and redirect the archive with < and >, then compress with a separate tool.
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.