lpr(1)
π lpr(1) β the OpenPrinting era of lpr, bestie edition π
okay so you wanna print stuff from the terminal like a whole main character? periodt. this is lpr from the OpenPrinting girlies, and she is literally the moment. let's get into it. π
β¨ NAME β¨
lpr β print files π¨οΈπ
πΈ SYNOPSIS πΈ
lpr [ -H server[:port] ] [ -E ] [ -U username ] [ -P
destination[/instance] ] [ -# num-copies [ -h ] [ -l ] [ -m ] [ -o
option[=value] ] [ -p ] [ -q ] [ -r ] [ -C title ] [ -J title ] [ -T
title ] [ file(s) ]
π¦ DESCRIPTION π¦
lpr submits files for printing. any files you name on the command line get sent to the printer you named β or to the default destination if you didn't name one. and if you list no files at all on the command line? she just reads the print file from standard input. iconic, honestly. β¨
π THE DEFAULT DESTINATION
CUPS gives you so many ways to set the default destination, bestie. here's the order of who gets consulted first:
- the
LPDESTandPRINTERenvironment variables β these get checked first, no cap. - if neither of those is set, the current default set using the
lpoptions(1)command is used. - and after that, the default set using the
lpadmin(8)command.
so basically: env vars, then lpoptions(1), then lpadmin(8). the way that's a whole priority queue π
π OPTIONS π
these are the options lpr actually recognizes, okurrr:
-Eβ forces encryption when connecting to the server. π-H server[:port]β specifies an alternate server. > note: this option must occur before all others. like, she needs to be first in line. she's the main character of the argument list. π-C "name"-J "name"-T "name"β sets the job name/title. βοΈ-P destination[/instance]β prints files to the named printer. π¨οΈ-U usernameβ specifies an alternate username. π-# copiesβ sets the number of copies to print. π’-hβ disables banner printing. this one is equivalent to-o job-sheets=none. bye bye banner π-lβ says the print file is already formatted for the destination and should be sent without filtering. equivalent to-o raw. straight up raw, no filter, no notes. β¨-mβ send an email on job completion. π§ bestie will let you know.-o option[=value]β sets a job option. see "COMMON JOB OPTIONS" below. π-pβ says the print file should be formatted with a shaded header with the date, time, job name, and page number. equivalent to-o prettyprint, and it's only useful when printing text files. so cute, so specific. π-qβ hold job for printing. she's waiting, bestie. βΈοΈ-rβ says the named print files should be deleted after submitting them. careful, that's permanent bestie π
π COMMON JOB OPTIONS
besides the printer-specific options that lpoptions(1) reports, you also get these generic options. slay:
-o job-sheets=nameβ prints a cover page (banner) with the document. the"name"can be"classified","confidential","secret","standard","topsecret", or"unclassified". very spy-movie of you π΅οΈ-o media=sizeβ sets the page size to size. most printers support at least the size names"a4","letter", and"legal".-o number-up={2|4|6|9|16}β prints 2, 4, 6, 9, or 16 document (input) pages on each output page. multi-tasking icon behavior β¨-o orientation-requested=4β prints the job in landscape (rotated 90 degrees counter-clockwise).-o orientation-requested=5β prints the job in landscape (rotated 90 degrees clockwise).-o orientation-requested=6β prints the job in reverse portrait (rotated 180 degrees). upside down, living her truth π-o print-quality=3-o print-quality=4-o print-quality=5β specifies the output quality β draft (3), normal (4), or best (5). π-o sides=one-sidedβ prints on one side of the paper.-o sides=two-sided-long-edgeβ prints on both sides of the paper for portrait output.-o sides=two-sided-short-edgeβ prints on both sides of the paper for landscape output.
β οΈ NOTES β οΈ
okay listen. the -c, -d, -f, -g, -i, -n, -t, -v, and -w options are not supported by CUPS and will produce a warning message if you use them. so like, don't. π
π EXAMPLES π
print two copies of a document to the default printer:
lpr -# 2 filename
print a double-sided legal document to a printer called "foo":
lpr -P foo -o media=legal -o sides=two-sided-long-edge filename
print a presentation document 2-up to a printer called "foo":
lpr -P foo -o number-up=2 filename
π§ SEE ALSO π§
cancel(1), lp(1), lpadmin(8), lpoptions(1), lpq(1), lprm(1), lpstat(1), CUPS Online Help (http://localhost:631/help)
π COPYRIGHT π
Copyright Β© 2020-2024 by OpenPrinting.
and that's the whole page, bestie!! this was the lpr(1) page from the CUPS crew at OpenPrinting, dated 2022-05-02. go print something iconic. no cap. π«Άβ¨
π¦ where this page comes from
- centos-stream 10: cups-client 1:2.4.10-18.el10 Β· Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause
- fedora 43: cups-client 1:2.4.14-2.fc43 Β· Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause
- fedora 43: cups-client 1:2.4.14-2.fc43 Β· Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause
- fedora 43: cups-client 1:2.4.19-3.fc43 Β· Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause
- fedora 44: cups-client 1:2.4.16-7.fc44 Β· Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause
- fedora 44: cups-client 1:2.4.16-7.fc44 Β· Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause
- fedora 44: cups-client 1:2.4.19-3.fc44 Β· Apache-2.0 WITH LLVM-exception AND BSD-3-Clause AND Zlib AND BSD-2-Clause
- Copyright Β© 2020-2024 by OpenPrinting
- Copyright Β© 2007-2019 by Apple Inc
- Copyright Β© 1997-2006 by Easy Software Products
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms