rlpr(1)
rlpr(1) β the UNIX Reference Manual, but make it make sense π
okay bestie, pull up a chair πͺ because this is rlpr, aka remote off-line print, and she is lowkey the glow-up the printing world needed.
β¨ NAME β¨
rlpr β remote off-line print π¨οΈ
πΈ SYNOPSIS πΈ
rlpr [-Hprinthost] [-Pprinter] [-Xproxyhost] [-#copies] [-Cclass]
[-Jjob] [-Ttitle] [-Uuser] [-i[indent]] [-wwidth]
[-1234cdfghlmnopqrstvNV] [--debug] [--port=port] [--hostname=hostname]
[--send-data-first] [--timeout=seconds] [--tmpdir=dir] [--verbose]
[--windows] [file ...]
π¦ DESCRIPTION π¦
so rlpr uses TCP/IP to yeet print jobs straight to lpd servers literally anywhere on a network. and the way that lpr makes you pre-register every remote printer on your local system (traditionally through /etc/printcap)? yeah no, rlpr said not me being that extra. she doesn't need that at all, which makes her way more flexible and needs like, basically zero administration. slay. π
you can use rlpr anywhere you'd use a traditional lpr, and she's backwards compatible with traditional BSD lpr. if rlpr gets invoked as lpr, she preserves all known lpr semantics, periodt. π
you can install and use rlpr in two different ways (and fr fr, the same guidelines apply for rlpq(1) and rlprm(1)):
- Ideally, if the
rlprclient can be installed setuid root, thenrlprcan interact directly with otherlpd's on the network. peek the EXAMPLES below for the tea. β¨ - If
rlprcannot be installed setuid root (say, because you're not the administrator on the machine you need to print from π), thenrlprcan be used alongside an rlprd proxy agent. check out CONFIGURING A PROXY and EXAMPLES below for the details.
π MOTIVATION π
traditional Berkeley lpr has one major drawback: the mortal user (a regular human, not root, tragic) cannot lpr to a printer that isn't explicitly listed in the /etc/printcap file.
and this is especially annoying when there's a central UNIX server that a bunch of users (on their own desktop computers) connect to for their daily work. if those users want to print files from the central server to their personal machines (assuming they even have a local lpd), they literally can't do it unless the central server's /etc/printcap gets edited to contain the host and printer of every single user on the network. and that, bestie, scales horribly. π
π OPTIONS π
Environment/Setup
--debugβ print gobs and gobs of debugging information. like, an unhinged amount. π-N,--no-bindβ don't try to bind to a privileged port before connecting tolpd. please please please see CONFIGURING A PROXY below for the info on when to use this one, it matters. π«Ά--port=numberβ pick an alternate port (instead of7290) to connect to, if you're usingrlprd. usually not needed ngl.-H,--printhost=hostβ select the host to print to (used with-P).
instead of using -H, you can just specify the hostname directly by including it with the printer name using the printer@hostname syntax. iykyk. β¨
-P,--printer=printername,--queue=printernameβ select the printer to print to (used with-H).-X,--proxyhost=proxyhostβ select the proxy host to use, if you need one.--timeout=secondsβ set the inactivity timer. if the connection hangs for more than seconds seconds, thenrlprwill give up. use the special value-1to wait forever (main character patience π ). default timeout is 3 seconds.--tmpdir=tmpdirβ use tmpdir for temporary files (by default,/tmpis used).-V,--versionβ print version and exit. short and sweet.
NOTE: instead of specifying the printer, printhost, or proxy variables on the commandline, you can set up defaults through either environment variables or rlprrc configuration files. for info on personal or system-widerlprrcfiles, seerlprrc(5). π
Behavior
-#,--copies=copiesβ print copies copies of each document. use sparingly bestie, printers aren't copiers. π-m,--mailβ send mail upon completion. π¬-q,--quiet,--silentβ quiet mode, stay quiet (except for fatal errors). the introvert setting.-r,--removeβ remove file after printing. poof, gone. π§-sβ Ignored (provided for compatibility). she's just there for the vibes.--send-data-firstβ send the"data"transaction before the"control"transaction. this should never be required whenrlpris used alongside a RFC 1179 conformantlpd. however, buggy implementations exist which require these semantics, so use only when necessary. β οΈ--verboseβ verbose mode. on by default unlessrlpris invoked aslpr.--windowsβ"Windows"mode, for printing multiple files to a windows-basedlpd. πͺ
Document Content
-1β print data usingtroff(1)R (times roman) font.-2β print data usingtroff(1)I (times italic) font.-3β print data usingtroff(1)B (times bold) font.-4β print data usingtroff(1)S (special) font.-cβ assume data has been produced bycifplot(1).-dβ assume data has been produced bytex(1).-fβ filter data assuming the start of each line has a fortran carriage control character.-gβ assume data has been produced by the BSD plot library.-lβ treat control characters as regular characters.-nβ assume data has been produced byditroff.-oβ assume data is postscript.-pβ print data usingpr(1).-tβ assume data has been produced bytroff(1).-vβ assume the data contains a raster image.
Document Format
-i,--indent=[cols]β indent output by cols columns (8by default).-h,--no-burstβ do not print burst (banner) page. no banner, no drama. π«-w,--width=widthβ use width for page width when usingpr(1).-C,--class=classβ use class for the class name on the burst page instead of the local system name.-J,--job=jobnameβ use jobname for the job name on the burst page instead of the first filename in the job.-T,--title=titleβ use title for the title when usingpr(1)instead of the current filename.-U,--user=usernameβ use username for the user name on the burst page instead of the actual username. (anonymity era π₯Έ)--hostname=hostnameβ use hostname for the hostname on the burst page instead of the local system name.
OS-Specific Extensions
see OS-SPECIFIC EXTENSIONS below for the deets on these options.
--ext=os--extension=osβ interpret the arguments passed to--extargsas if on operating system os. currently, os must be eitherhpuxornone.--extargs="args"β change behavior according to OS-specific arguments listed in args.
π CONFIGURING A PROXY π
okay so, in situations where the rlpr client can't be installed setuid root, rlpr often cannot directly talk to an lpd, because most lpd's require that requests come from privileged ports. unfortunately, rlpr cannot "come from a privileged port" without having superuser status. and the privileged port requirement? that's part of RFC 1179. can't argue with the RFC, bestie. π
that said, some lpd's β most notably some of the ones which have shipped with Windows NT, Solaris, and NCRunix β do not require requests to come from a privileged port. so before you go through all the work of configuring a proxy, you should make sure one is actually required for your situation. you can check by just trying to run rlpr: if it's successful in spooling the job, you do not need to install rlpr setuid root. in that case you should pass the -N (or the more verbose --no-bind) to rlpr in the future to suppress rlpr's warning messages. π
if your situation doesn't require a privileged port, do not use one. you can explicitly request a regular port, even when rlpr has been installed setuid root, by using the --no-bind option. this is a good idea because there are only 11 privileged ports that the RFC allows. practical implication? it limits your print requests to about 11 per every 3 minutes, which is often unacceptable. not the vibe. π«
the rest of this section assumes that rlpr cannot be installed setuid root in your situation, and that a remote lpd requires rlpr to connect to it from a privileged port. it requires that you or someone you know has root access to another machine on the network, so that you can use a proxy β known as rlprd β to get around the problem. π΅οΈ
rlprd works by taking lpd requests on a non-privileged port, mapping them to a privileged port, and sending them out to the real lpd. the proxy and the lpd do not need to be on the same machine. iconic. β¨
in the scenario provided in the motivation, if each user had root access on his own machine, it would be optimal for the user to start rlprd up on his own machine, in which case the proxy and the printhost are the same machine. the user would additionally have to make sure his own machine was listed in his local /etc/hosts.lpd so that his lpd would accept connections from his rlprd. π«Ά
however, if the machine the user wants to print to isn't running unix (but is running an lpd) (i.e. Windows, WinNT, etc) β then that user can configure his lpd to accept connections from an rlprd running somewhere on the network, and use that rlprd as a proxy for rlpr. π«
for more on this mess, see rlprd(8).
β EXAMPLES β
WITHOUT A PROXY (rlpr is setuid root)
sun% rlpr --printer=hp4l@foo.bar.org foo.c
prints foo.c to the printer hp4l on the host foo.bar.org (assuming foo.bar.org has been configured to accept print requests from host sun in its /etc/hosts.lpd).
sun% who | rlpr --printer=hp4l@foo.bar.org
prints the output of who(1) to the printer hp4l on the host foo.bar.org.
WITH A PROXY (rlpr is a normal program)
sun% rlpr -Xfoo.bar.org --printer=hp4l@foo.bar.org foo.c
prints foo.c to the printer hp4l on the host foo.bar.org using foo.bar.org as a proxyhost. under this configuration, foo.bar.org needs to be configured to accept print requests from the proxy (itself) and not from sun. in situations where the proxy and the printhost are not the same machine, this can lead to some security holes due to the original lameness of berkeley lpd's host-based security. β οΈ
NOTE: if a proxyhost isn't specified anywhere, rlpr assumes one isn't necessary.
π OS-SPECIFIC EXTENSIONS π
some vendors have added features to their BSD-based lpr products, which are upwardly compatible with lpr but incompatible with one another. to support these extensions, rlpr allows the user to indicate what operating system to emulate and provide a string of OS-specific options β either through commandline arguments or environment variables. ποΈ
note that for correct operation, these extensions should only be used when interoperating with an lpd provided by the vendor for the indicated operating system.
π ENVIRONMENT VARIABLES π
okay bestie, here's the tea on the env vars rlpr is literally obsessed with π«Ά
RLPR_EXTENSIONβ tells it which operating system to interpret the OS-specific arguments relative to. like, "hey, read these args the way this OS would" πRLPR_EXTARGSβ this is where the OS-specific arguments actually live β¨RLPR_PRINTHOSTβ the default host you wanna print to, no cap πPRINTERorLPDESTβ sets a default printer (printqueue) to use.PRINTERgets consulted first, and thenLPDEST. order matters, queen π
not me also pointing out: you can set the host to print to by making printer beprinter@hostnameπ this can be more convenient than settingRLPR_PRINTHOST, but heads up β it will confuse the traditional BSD print commands π so like, pick your battles.
RLPR_PROXYHOSTβ specifies a proxy host to use, if necessary π¦RLPR_CONFDIRβ if it's set, it's the directory holding the system-widerlprrcfile. by default,/etcis used πΈTMPDIRβ if it's set, it's used for temporary files. by default,/tmpis used π
π FILES π
the little roster of files in this girl's life:
~/.rlprrcβ personal printer/host database π$TMPDIR/cf*β temporary control files on local machine$TMPDIR/df*β temporary data file for jobs from stdin/var/spool/*/cf*β temporary control files on printhost/var/spool/*/df*β temporary data files on printhost/etc/hosts.lpdβ host-based security on printhost π/etc/passwdβ personal identification/etc/rlprrcβ system-wide printer/host database (by default)
π SEE ALSO π
go read these next, iykyk:
π AUTHOR π
meem <meem@gnu.org> β the icon, the legend, the moment π
π BUGS / LIMITATIONS π
some evil applications have lpr hardcoded into them π that's it. that's the limitation. not me crying about it.
and that's the whole page bestie!! this was rlpr 2.04, dated 2000/12/30, living in rlpr(1) β iconic behavior honestly, ate and left no crumbs π
β¨π
π¦ where this page comes from
- debian bookworm: rlpr 2.05-5+b2
- debian trixie: rlpr 2.06-2 Β· GPL-1.0-or-later
- ubuntu jammy: rlpr 2.05-5
- ubuntu noble: rlpr 2.06-2build1 Β· GPL-1.0-or-later
- ubuntu questing: rlpr 2.06-3
- ubuntu resolute: rlpr 2.06-3build1 Β· GPL-1.0-or-later
- ubuntu stonking: rlpr 2.06-3build1 Β· GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms