]> git.ipfire.org Git - thirdparty/cups.git/blob - doc/help/man-lp.html
7b3e4483908a891bb2ff88888ace6a7df6f01093
[thirdparty/cups.git] / doc / help / man-lp.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta name="creator" content="mantohtml v2.0.2">
5 <title>lp(1)</title>
6 </head>
7 <body>
8 <h1 id="lp-1">lp(1)</h1>
9 <h2 id="lp-1.name">Name</h2>
10 <p>lp - print files
11 </p>
12 <h2 id="lp-1.synopsis">Synopsis</h2>
13 <p><strong>lp</strong>
14 [
15 <strong>-h </strong><em>hostname</em>[<strong>:</strong><em>port</em>]
16 ] [
17 <strong>-E</strong>
18 ] [
19 <strong>-U</strong>
20 <em>username</em>
21 ] [
22 <strong>-c</strong>
23 ] [
24 <strong>-d </strong><em>destination</em>[<strong>/</strong><em>instance</em>]
25 ] [
26 <strong>-m</strong>
27 ] [
28 <strong>-n</strong>
29 <em>num-copies</em>
30 ] [
31 <strong>-o </strong><em>option</em>[<strong>=</strong><em>value</em>]
32 ] [
33 <strong>-q</strong>
34 <em>priority</em>
35 ] [
36 <strong>-s</strong>
37 ] [
38 <strong>-t</strong>
39 <em>title</em>
40 ] [
41 <strong>-H</strong>
42 <em>handling</em>
43 ] [
44 <strong>-P</strong>
45 <em>page-list</em>
46 ] [
47 <strong>--</strong>
48 ] [
49 <em>file(s)</em>
50 ]
51 <br>
52 <strong>lp</strong>
53 [
54 <strong>-h </strong><em>hostname</em>[<strong>:</strong><em>port</em>]
55 ] [
56 <strong>-E</strong>
57 ] [
58 <strong>-U</strong>
59 <em>username</em>
60 ] [
61 <strong>-c</strong>
62 ] [
63 <strong>-i</strong>
64 <em>job-id</em>
65 ] [
66 <strong>-n</strong>
67 <em>num-copies</em>
68 ] [
69 <strong>-o </strong><em>option</em>[<strong>=</strong><em>value</em>]
70 ] [
71 <strong>-q</strong>
72 <em>priority</em>
73 ] [
74 <strong>-t</strong>
75 <em>title</em>
76 ] [
77 <strong>-H</strong>
78 <em>handling</em>
79 ] [
80 <strong>-P</strong>
81 <em>page-list</em>
82 ]
83 </p>
84 <h2 id="lp-1.description">Description</h2>
85 <p><strong>lp</strong> submits files for printing or alters a pending job.
86 Use a filename of &quot;-&quot; to force printing from the standard input.
87 </p>
88 <h3 id="lp-1.description.the-default-destination">The Default Destination</h3>
89 <p>CUPS provides many ways to set the default destination. The <strong>LPDEST</strong> and <strong>PRINTER</strong> environment variables are consulted first.
90 If neither are set, the current default set using the
91 <a href="lpoptions.html"><strong>lpoptions</strong>(1)</a>
92
93 command is used, followed by the default set using the
94 <a href="lpadmin.html"><strong>lpadmin</strong>(8)</a>
95
96 command.
97 </p>
98 <h2 id="lp-1.options">Options</h2>
99 <p>The following options are recognized by <em>lp</em>:
100 </p>
101 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>--</strong><br>
102 Marks the end of options; use this to print a file whose name begins with a dash (-).
103 </p>
104 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-E</strong><br>
105 Forces encryption when connecting to the server.
106 </p>
107 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-U </strong><em>username</em><br>
108 Specifies the username to use when connecting to the server.
109 </p>
110 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-c</strong><br>
111 This option is provided for backwards-compatibility only. On systems that support it, this option forces the print file to be copied to the spool directory before printing.
112 In CUPS, print files are always sent to the scheduler via IPP which has the same effect.
113 </p>
114 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-d </strong><em>destination</em><br>
115 Prints files to the named printer.
116 </p>
117 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-h </strong><em>hostname</em>[<strong>:</strong><em>port</em>]<br>
118 Chooses an alternate server.
119 Note: This option must occur before all others.
120 </p>
121 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-i </strong><em>job-id</em><br>
122 Specifies an existing job to modify.
123 </p>
124 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-m</strong><br>
125 Sends an email when the job is completed.
126 </p>
127 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-n </strong><em>copies</em><br>
128 Sets the number of copies to print.
129 </p>
130 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o &quot;</strong><em>name</em><strong>=</strong><em>value </em>[ ... <em>name</em><strong>=</strong><em>value </em>]<strong>&quot;</strong><br>
131 Sets one or more job options.
132 See &quot;COMMON JOB OPTIONS&quot; below.
133 </p>
134 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-q </strong><em>priority</em><br>
135 Sets the job priority from 1 (lowest) to 100 (highest).
136 The default priority is 50.
137 </p>
138 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-s</strong><br>
139 Do not report the resulting job IDs (silent mode.)
140 </p>
141 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-t &quot;</strong><em>name</em><strong>&quot;</strong><br>
142 Sets the job name.
143 </p>
144 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-H </strong><em>hh:mm</em><br>
145 </p>
146 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-H hold</strong><br>
147 </p>
148 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-H immediate</strong><br>
149 </p>
150 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-H restart</strong><br>
151 </p>
152 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-H resume</strong><br>
153 Specifies when the job should be printed.
154 A value of <em>immediate</em> will print the file immediately, a value of <em>hold</em> will hold the job indefinitely, and a UTC time value (HH:MM) will hold the job until the specified UTC (not local) time.
155 Use a value of <em>resume</em> with the <em>-i</em> option to resume a held job.
156 Use a value of <em>restart</em> with the <em>-i</em> option to restart a completed job.
157 </p>
158 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-P </strong><em>page-list</em><br>
159 Specifies which pages to print in the document.
160 The list can contain a list of numbers and ranges (#-#) separated by commas, e.g., &quot;1,3-5,16&quot;.
161 The page numbers refer to the output pages and not the document's original pages - options like &quot;number-up&quot; can affect the numbering of the pages.
162 </p>
163 <h3 id="lp-1.options.common-job-options">Common Job Options</h3>
164 <p>Aside from the printer-specific options reported by the
165 <a href="lpoptions.html"><strong>lpoptions</strong>(1)</a>
166
167 command, the following generic options are available:
168 </p>
169 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o job-sheets=</strong><em>name</em><br>
170 Prints a cover page (banner) with the document.
171 The &quot;name&quot; can be &quot;classified&quot;, &quot;confidential&quot;, &quot;secret&quot;, &quot;standard&quot;, &quot;topsecret&quot;, or &quot;unclassified&quot;.
172 </p>
173 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o media=</strong><em>size</em><br>
174 Sets the page size to <em>size</em>. Most printers support at least the size names &quot;a4&quot;, &quot;letter&quot;, and &quot;legal&quot;.
175 </p>
176 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o number-up=</strong>{<em>2|4|6|9|16</em>}<br>
177 Prints 2, 4, 6, 9, or 16 document (input) pages on each output page.
178 </p>
179 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o orientation-requested=4</strong><br>
180 Prints the job in landscape (rotated 90 degrees counter-clockwise).
181 </p>
182 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o orientation-requested=5</strong><br>
183 Prints the job in landscape (rotated 90 degrees clockwise).
184 </p>
185 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o orientation-requested=6</strong><br>
186 Prints the job in reverse portrait (rotated 180 degrees).
187 </p>
188 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o print-as-raster</strong><br>
189 Prints the job as raster.
190 </p>
191 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o print-quality=3</strong><br>
192 </p>
193 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o print-quality=4</strong><br>
194 </p>
195 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o print-quality=5</strong><br>
196 Specifies the output quality - draft (3), normal (4), or best (5).
197 </p>
198 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o sides=one-sided</strong><br>
199 Prints on one side of the paper.
200 </p>
201 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o sides=two-sided-long-edge</strong><br>
202 Prints on both sides of the paper for portrait output.
203 </p>
204 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>-o sides=two-sided-short-edge</strong><br>
205 Prints on both sides of the paper for landscape output.
206 </p>
207 <h2 id="lp-1.environment">Environment</h2>
208 <p>The following environment variables override the default destination:
209 </p>
210 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>LPDEST</strong><br>
211 Specifies the default print queue (System V standard).
212 </p>
213 <p style="margin-left: 2.5em; text-indent: -2.5em;"><strong>PRINTER</strong><br>
214 Specifies the default print queue (Berkeley standard).
215 </p>
216 <h2 id="lp-1.conforming-to">Conforming To</h2>
217 <p>Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, &quot;/&quot;, or &quot;#&quot;.
218 Also, printer and class names are <em>not</em> case-sensitive.
219 </p>
220 <p>The <em>-q</em> option accepts a different range of values than the Solaris lp command, matching the IPP job priority values (1-100, 100 is highest priority) instead of the Solaris values (0-39, 0 is highest priority).
221 </p>
222 <h2 id="lp-1.examples">Examples</h2>
223 <p>Print two copies of a document to the default printer:
224 </p>
225 <pre>
226 lp -n 2 filename
227
228 </pre>
229 <p>Print a double-sided legal document to a printer called &quot;foo&quot;:
230 </p>
231 <pre>
232 lp -d foo -o media=legal -o sides=two-sided-long-edge filename
233
234 </pre>
235 <p>Print a presentation document 2-up to a printer called &quot;bar&quot;:
236 </p>
237 <pre>
238 lp -d bar -o number-up=2 filename
239 </pre>
240 <h2 id="lp-1.see-also">See Also</h2>
241 <a href="cancel.html"><p><strong>cancel</strong>(1),</a>
242
243 <a href="lpadmin.html"><strong>lpadmin</strong>(8),</a>
244
245 <a href="lpoptions.html"><strong>lpoptions</strong>(1),</a>
246
247 <a href="lpq.html"><strong>lpq</strong>(1),</a>
248
249 <a href="lpr.html"><strong>lpr</strong>(1),</a>
250
251 <a href="lprm.html"><strong>lprm</strong>(1),</a>
252
253 <a href="lpstat.html"><strong>lpstat</strong>(1),</a>
254
255 CUPS Online Help (<a href="http://localhost:631/help">http://localhost:631/help</a>)
256 </p>
257 <h2 id="lp-1.copyright">Copyright</h2>
258 <p>Copyright &copy; 2020-2024 by OpenPrinting.
259 </body>
260 </html>