lpr(1b) on Solnix vs Linux and the BSDs
On Solnix, lpr is the illumos BSD-compatibility print command, at /usr/bin/lpr on PATH. It finds printers through the name service switch "printers" database and printers.conf, not printcap, and it lacks the BSD options -r, -q, -U, -R and -o.
The manual pages
- Solnix: lpr(1b) from
pkgs.solnix.illumos-world-man· illumos.org - FreeBSD: lpr(1) 15.1-RELEASE
- OpenBSD: lpr(1) 8.0
- NetBSD: lpr(1) 11.0
What Solnix runs
A default Solnix system runs the illumos lpr at /usr/bin/lpr. The page in the bundle documents /usr/ucb/lpr, which is also shipped. The bundle does not say how /usr/bin/lpr differs from /usr/ucb/lpr, so check them separately. The page points to lp(1) and lpstat(1) as the System V print commands.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| FreeBSD, OpenBSD, NetBSD | printer database | Solnix lpr locates destinations through the "printers" database in the name service switch (nsswitch.conf, printers.conf). The BSD pages point to printcap(5) and the lpd(8) spooler instead. Source: Solnix lpr(1b) DESCRIPTION, SEE ALSO; FreeBSD/OpenBSD/NetBSD lpr(1) SEE ALSO (printcap(5), lpd(8)) |
| FreeBSD, OpenBSD, NetBSD | PRINTER environment variable | The FreeBSD, OpenBSD and NetBSD pages say lpr uses PRINTER as the default printer. The Solnix page has no ENVIRONMENT section and does not mention PRINTER, so do not rely on it there. Source: FreeBSD/OpenBSD/NetBSD lpr(1) ENVIRONMENT; Solnix lpr(1b) (no ENVIRONMENT section) |
| FreeBSD, OpenBSD, NetBSD | -P destination syntax | Solnix -P takes a printer or class of printers, written as an atomic name, a URI-style name (scheme://endpoint) or a POSIX-style name (server:destination). The BSD pages describe -P only as forcing output to a specific printer.Source: Solnix lpr(1b) -P; FreeBSD/OpenBSD/NetBSD lpr(1) -P |
| FreeBSD, OpenBSD, NetBSD | -r missing | Solnix lpr has no -r. The BSD versions use -r to remove the file after spooling, or after printing when -s is also given. A BSD script using -r leaves the file behind on Solnix, or fails.Source: Solnix lpr(1b) SYNOPSIS; FreeBSD/OpenBSD/NetBSD lpr(1) -r |
| OpenBSD, NetBSD | -q missing | Solnix lpr has no -q, which on OpenBSD and NetBSD queues the job without starting the spooling daemon.Source: Solnix lpr(1b) SYNOPSIS; OpenBSD lpr(1) -q; NetBSD lpr(1) -q |
| NetBSD | -R job number | NetBSD -R prints the job's unique number to standard output, for use with lprm and lpq. Solnix lpr has no -R, and its page does not say how to get the job number.Source: NetBSD lpr(1) -R; Solnix lpr(1b) SYNOPSIS |
| FreeBSD, OpenBSD, NetBSD | -U user missing | Solnix lpr has no -U. On the BSDs, -U sets the user name on the burst page and is honoured only if the real user ID is daemon (or the printcap-configured user).Source: FreeBSD/OpenBSD/NetBSD lpr(1) -U; Solnix lpr(1b) SYNOPSIS |
| FreeBSD, OpenBSD, NetBSD | -i, -T and -w only with -p | On Solnix, -i, -T and -w are ignored unless -p is also given. The BSD pages describe -T and -w as options for pr(1) and do not state this rule for -i.Source: Solnix lpr(1b) -i, -T, -w; FreeBSD/OpenBSD/NetBSD lpr(1) -i, -T, -w |
| FreeBSD, OpenBSD, NetBSD | -i argument form | Solnix -i takes an optional indent, defaulting to eight spaces. OpenBSD matches that. FreeBSD documents -i numcols with no default, and NetBSD documents -i -numcols.Source: Solnix lpr(1b) -i; OpenBSD lpr(1) -i; FreeBSD lpr(1) -i; NetBSD lpr(1) -i |
| NetBSD | PostScript option | NetBSD -o marks files as PostScript. Solnix lpr has no -o. It says that if no filter option is given and the printer can interpret PostScript, a file starting with %! is treated as PostScript.Source: NetBSD lpr(1) -o; Solnix lpr(1b) -filter_option |
| FreeBSD, OpenBSD, NetBSD | -s scope | Solnix -s avoids copying files only when the print queue is local and the files are named on the command line. The BSD pages say -s uses symlink(2) to link data files and do not state this restriction.Source: Solnix lpr(1b) -s; FreeBSD/OpenBSD/NetBSD lpr(1) -s |
| FreeBSD, OpenBSD, NetBSD | file limit and exit status | Solnix truncates a request of more than 52 files to 52 when the BSD print protocol is used. Solnix documents exit 0 on success and non-zero on error. The BSD pages document neither. Source: Solnix lpr(1b) DESCRIPTION, EXIT STATUS; FreeBSD/OpenBSD/NetBSD lpr(1) (no such text) |
| FreeBSD | -L and -Z missing | Solnix lpr has no -L (locale for pr) and no -Z (extra daemon options for LPRng), both of which FreeBSD documents.Source: FreeBSD lpr(1) -L, -Z; Solnix lpr(1b) SYNOPSIS |
Standards
- POSIX: lpr is not a POSIX.1-2024 utility.
- Solnix: Interface Stability: Standard. CSI: enabled, except for the printer name.
- FreeBSD: The page has no STANDARDS section. HISTORY says the lpr command appeared in 3BSD.
- OpenBSD: The page has no STANDARDS section. HISTORY says the lpr command appeared in Version 5 AT&T UNIX.
- NetBSD: The page has no STANDARDS section. HISTORY says the lpr command appeared in 3BSD.
Writing portable scripts
- Use only
-P, -#,-C,-J,-hand-macross Solnix and the BSDs. Avoid-r,-q,-R,-U,-o,-Land-Z, which are missing on Solnix or not on every BSD. - Do not rely on the PRINTER variable on Solnix. Pass
-Pprinter explicitly, and use a name that the local printers database (Solnix) or printcap (BSD) knows.
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.