1lp(1) User Commands lp(1)
2
3
4
6 lp - submit print request
7
9 lp [-c] [-m] [-p] [-s] [-w] [-d destination] [-f form-name]
10 [-H special-handling] [-n number] [-o option]
11 [-P page-list] [-q priority-level]
12 [-S character-set | print-wheel] [-t title]
13 [-T content-type [-r]] [-y mode-list] [file]...
14
15
16 lp -i request-ID... [-c] [-m] [-p] [-s] [-w]
17 [-d destination] [-f form-name] [-H special-handling]
18 [-n number] [-o option] [-P page-list]
19 [-q priority-level] [-S character-set | print-wheel]
20 [-t title] [-T content-type [-r]] [-y mode-list]
21
22
24 The lp utility submits print requests to a destination. There are two
25 formats of the lp command.
26
27
28 The first form of lp prints files (file) and associated information
29 (collectively called a print request). If file is not specified, lp
30 assumes the standard input. Use a hyphen (−) with file to specify the
31 standard input. Files are printed in the order in which they appear on
32 the command line.
33
34
35 The second form of lp changes print request options. This form of lp
36 can only be used with print services and protocols that support job
37 modification. The LP print service allows print requests to be modified
38 when they are in a queue local to the system that the lp commands was
39 executed on. The Internet Print Protocol (IPP) allows job modification
40 on remote ipp print services.
41
42
43 The print request identified by request-ID is changed according to the
44 printing options specified. The printing options available are the same
45 as those with the first form of the lp. If the request has finished
46 printing when the lp command is executed, the change is rejected. If
47 the request is in the process of printing, it is stopped and restarted
48 from the beginning (unless the -P option has been given).
49
50
51 The print client commands locate destination information using the
52 "printers" database in the name service switch. See nsswitch.conf(4),
53 printers(4), and printers.conf(4) for details.
54
56 Printers that have a 4.x or BSD-based print server are not configured
57 to handle BSD protocol extensions. lp handles print requests sent to
58 such destinations differently (see NOTES).
59
60
61 The following options are supported:
62
63 -c Copies file before printing.
64
65 Unless -c is specified, users should not remove
66 any file before the print request has completely
67 printed. Changes made to file after the print
68 request is made but before it is printed might
69 be reflected in the printed output. file is
70 linked (as opposed to copied).
71
72
73 -d destination Prints file on a specific destination. The -d
74 option is used to set the destination only when
75 the job is first created. (Note: To move exist‐
76 ing jobs to a different destination, see
77 lpmove(1M).) destination can be either a printer
78 or a class of printers (see lpadmin(1M)). Spec‐
79 ify destination using atomic, URI-style
80 (scheme://endpoint), or POSIX-style (server:des‐
81 tination) names. See printers.conf(4) for more
82 information.
83
84
85 -f form-name Prints file on form-name. The LP print service
86 ensures that the form is mounted on the printer.
87 The print request is rejected if the printer
88 does not support form-name, if form-name is not
89 defined for the system, or if the user is not
90 allowed to use form-name (see lpforms(1M)).
91
92
93 -H special-handling Prints the print request according to the value
94 of special-handling. The following special-han‐
95 dling values are acceptable:
96
97 hold Do not print the print request
98 until notified. If printing has
99 already begun, stop it. Other print
100 requests are placed ahead of a
101 request that has been put on hold
102 (held print request) until the
103 print request is resumed.
104
105
106 resume Resume a held print request. If the
107 print request had begun to print
108 when held, it is the next print
109 request printed, unless it is
110 superseded by an immediate print
111 request.
112
113
114 immediate Print the print request next. If
115 more than one print request is
116 assigned, the most recent print
117 request is printed next. If a print
118 request is currently printing on
119 the desired printer, a hold request
120 must be issued to allow the immedi‐
121 ate request to print. The immediate
122 request is only available to LP
123 administrators.
124
125
126
127 -i request-ID Changes options for the print request identified
128 by request-ID. There must be a space between -i
129 and request-ID.
130
131 This option applies to jobs that are in a local
132 queue on a print server. This also applies to
133 remote queues on when the remote print server
134 supports IPP with job modification.
135
136
137 -m Sends mail after file has printed (see mail(1)).
138 By default, no mail is sent upon normal comple‐
139 tion of a print request.
140
141
142 -n number Prints a specific number of copies of file.
143 Specify number as a digit. The default for num‐
144 ber is 1.
145
146
147 -o option Specifies printer-dependent options. Specify
148 several options by specifying -o option multiple
149 times (-o option -o option -o option ). Printer-
150 dependent options can also be specified using
151 the -o keyletter once, followed by a list of
152 options enclosed in double quotes (-o"option
153 option option").
154
155 options take the following forms:
156
157 key=value Associates information with the
158 request for use by the backend
159 print service. The keys and values
160 that can be used are specific to
161 the backend print service and queue
162 configuration.
163
164
165 [no]key Associates boolean information
166 with the request for use by the
167 backend print service. The keys
168 that can be used are specific to
169 the backend print service and queue
170 configuration.
171
172 The following options are commonly used with the
173 LP print service:
174
175 nobanner
176
177 Does not print a banner page with the
178 request. This option can be disallowed by
179 the LP administrator.
180
181 On a system that is configured with Trusted
182 Extensions, use of this option requires the
183 solaris.print.nobanner authorization.
184
185
186 nofilebreak
187
188 Prints multiple files without inserting a
189 form feed between them.
190
191
192 nolabels
193
194 On a system that is configured with Trusted
195 Extensions, specifies suppression of page
196 header and footer labels. Use of this option
197 requires the solaris.print.unlabeled autho‐
198 rization.
199
200
201 length=numberi | numberc | number
202
203 Prints the print request with pages of a
204 specific length in inches, centimeters, or
205 number of lines. Append the letter i for
206 inches or c for centimenters to number.
207 Indicate the number of lines by specifying
208 number alone. length=66 indicates a page
209 length of 66 lines. length=11i indicates a
210 page length of 11 inches. length=27.94c
211 indicates a page length of 27.94 centime‐
212 ters.
213
214 This option can not be used with the -f
215 option.
216
217
218 width=numberi | numberc | number
219
220 Prints the print request with pages of a
221 specific width in inches, centimeters, or
222 number of columns. Append the letter i for
223 inches or c for centimeters to number. Indi‐
224 cate the number of columns by specifying
225 number alone. width=65 indicates a page
226 width of 65 columns. width=6.5i indicates a
227 page width of 6.5 inches. width=10c indi‐
228 cates a page width of 10 centimeters.
229
230 This option can not be used with the -f
231 option.
232
233
234 lpi=number
235
236 Prints the print request with the line pitch
237 set to number lines in an inch. Use number
238 to specify the number of lines in an inch.
239
240 This option can not be used with the -f
241 option.
242
243
244 cpi=n|pica|elite|compressed
245
246 Prints the print request with the character
247 pitch set to number characters in an inch.
248 Use number to specify the number of charac‐
249 ters in an inch. Use pica to set character
250 pitch to pica (10 characters per inch), or
251 elite to set character pitch to elite (12
252 characters per inch) Use compressed to set
253 character pitch to as many characters as the
254 printer can handle. There is no standard
255 number of characters per inch for all print‐
256 ers; see the terminfo database (see ter‐
257 minfo(4)) for the default character pitch
258 for your printer. This option can not be
259 used with the -f option.
260
261
262 stty=stty-option-list
263
264 Prints the request using a list of options
265 valid for the stty command (see stty(1).
266 Enclose the list in single quotes (`') if it
267 contains blanks.
268
269
270
271 -P page-list Prints the pages specified in page-list in
272 ascending order. Specify page-list as a of range
273 of numbers, single page number, or a combination
274 of both.
275
276 The -P option can only be used if there is a
277 filter available to handle it; otherwise, the
278 print request is rejected.
279
280
281 -p Enables notification on completion of the print
282 request. Delivery of the notification is depen‐
283 dent on additional software.
284
285
286 -q priority-level Assigns the print request a priority in the
287 print queue. Specify priority-level as an inte‐
288 ger between from 0 and 39. Use 0 to indicate the
289 highest priority; 39 to indicate the lowest pri‐
290 ority. If no priority is specified, the default
291 priority for a print service is assigned by the
292 LP administrator. The LP administrator can also
293 assign a default priority to individual users.
294
295
296 -s Suppresses the display of messages sent from lp.
297
298
299 -S character-set | Prints the request using the character-set or
300 -S print-wheel print-wheel. If a form was requested and
301 requires a character set or print wheel other
302 than the one specified with the -S option, the
303 request is rejected. Printers using mountable
304 print wheels or font cartridges use the print
305 wheel or font cartridge mounted at the time of
306 the print request, unless the -S option is spec‐
307 ified.
308
309 Printers Using Print Wheels: If print wheel is
310 not one listed by the LP administrator as
311 acceptable for the printer the request is
312 rejected unless the print wheel is already
313 mounted on the printer.
314
315 Printers Using Selectable or Programmable Char‐
316 acter Sets: If the -S option is not specified,
317 lp uses the standard character set. If charac‐
318 ter-set is not defined in the terminfo database
319 for the printer (see terminfo(4)), or is not an
320 alias defined by the LP administrator, the
321 request is rejected.
322
323
324 -t title Prints a title on the banner page of the output.
325 Enclose title in quotes if it contains blanks.
326 If title is not not specified, the name of the
327 file is printed on the banner page.
328
329
330 -Tcontent-type [-r] Prints the request on a printer that can support
331 the specified content-type. If no printer
332 accepts this type directly, a filter is used to
333 convert the content into an acceptable type. If
334 the -r option is specified, a filter is not
335 used. If -r is specified, and no printer accepts
336 the content-type directly, the request is
337 rejected. If the content-type is not acceptable
338 to any printer, either directly or with a fil‐
339 ter, the request is rejected.
340
341
342 -w Writes a message on the user's terminal after
343 the files have been printed. If the user is not
344 logged in, then mail is sent instead.
345
346
347 -y mode-list Prints the request according to the printing
348 modes listed in mode-list. The allowed values
349 for mode-list are locally defined.
350
351 This option can be used only if there is a fil‐
352 ter available to handle it; otherwise, the print
353 request is rejected.
354
355
357 The following operand is supported:
358
359 file The name of the file to be printed. Specify file as a pathname
360 or as a hyphen (−) to indicate the standard input. If file is
361 not specified, lp uses the standard input.
362
363
365 See largefile(5) for the description of the behavior of lp when encoun‐
366 tering files greater than or equal to 2 Gbyte ( 2^31 bytes).
367
369 See environ(5) for descriptions of the following environment variables
370 that affect the execution of lp: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
371 NLSPATH, and PATH.
372
373 LC_TIME Determine the format and contents of date and time strings
374 displayed in the lp banner page, if any.
375
376
377 LPDEST Determine the destination. If the LPDEST environment vari‐
378 able is not set, the PRINTER environment variable shall be
379 used. The -d dest option takes precedence over LPDEST.
380 Results are undefined when -d is not specified and LPDEST
381 contains a value that is not a valid destination name.
382
383
384 PRINTER Determine the output device or destination. If the LPDEST
385 and PRINTER environment variables are not set, an unspeci‐
386 fied output device is used. The -d dest option and the
387 LPDEST environment variable shall take precedence over
388 PRINTER. Results are undefined when -d is not specified,
389 LPDEST is unset, and PRINTER contains a value that is not a
390 valid device or destination name.
391
392
393 TZ Determine the timezone used to calculate date and time
394 strings displayed in the lp banner page, if any. If TZ is
395 unset or null, an unspecified default timezone shall be
396 used.
397
398
400 The following exit values are returned:
401
402 0 Successful completion.
403
404
405 non-zero An error occurred.
406
407
409 /etc/printers.conf System printer configuration database
410
411
412 $HOME/.printers User-configurable printer database
413
414
415 ou=printers LDAP version of /etc/printers.conf
416
417
418 printers.conf.byname NIS version of /etc/printers.conf
419
420
421 printers.org_dir NIS+ version of /etc/printers.conf
422
423
425 See attributes(5) for descriptions of the following attributes:
426
427
428
429
430 ┌─────────────────────────────┬─────────────────────────────┐
431 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
432 ├─────────────────────────────┼─────────────────────────────┤
433 │Availability │SUNWlp-cmds │
434 ├─────────────────────────────┼─────────────────────────────┤
435 │CSI │Enabled. See NOTES. │
436 ├─────────────────────────────┼─────────────────────────────┤
437 │Interface Stability │Standard │
438 └─────────────────────────────┴─────────────────────────────┘
439
441 cancel(1), enable(1), lpq(1B), lpr(1B), lprm(1B), lpstat(1), mail(1),
442 postprint(1), pr(1), stty(1), accept(1M), lpadmin(1M), lpfilter(1M),
443 lpforms(1M), lpmove(1M), lpsched(1M), lpshut(1M), lpsystem(1M),
444 lpusers(1M), nsswitch.conf(4), printers(4), printers.conf(4), ter‐
445 minfo(4), attributes(5), environ(5), largefile(5), standards(5)
446
448 CSI-capability assumes that printer names are composed of ASCII charac‐
449 ters.
450
451
452 Print jobs are assumed to contain one type of data. That type of data
453 is either specified on the command line or autodetected (simple, Post‐
454 Script) based on the contents of the first file in the job.
455
456
457 When using the BSD printing protocol to send print requests to a remote
458 print service, functionality is limited.
459
460
461 Printers that have a 4.x or BSD-based print server are not configured
462 to handle BSD protocol extensions. lp handles print requests sent to
463 such printers in the following ways:
464
465 1. Print requests with more than 52 filenames are truncated to
466 52 files.
467
468 2. The -f, -H, -o, -P, -p, -q, -S, -T, and -y options might
469 require a protocol extension to pass to a print server. If
470 lp cannot handle the print request, it displays a warning
471 message.
472
473 LP administrators enable protocol extensions by setting a
474 printer's printer-uri-supported (or bsdaddr) entry in
475 /etc/printers.conf. Changing the printer-uri-supported entry
476 in /etc/printers.conf to:
477
478 printer-uri-supported=lpd\://server/printers/destination#Solaris
479
480
481
482 bsdaddr=server,destination,Solaris
483
484
485 Adding Solaris to either of these values causes the lp com‐
486 mand to generate a set of BSD print protocol extensions that
487 can be processed by a Solaris print server.
488
489
490 As a result of several limitations in the BSD print protocol, it is
491 recommended that the IPP protocol be used for communication with print
492 servers.
493
494
495 When IPP is in use, the user is prompted for a passphrase if the remote
496 print service is configured to require authentication.
497
498
499
500SunOS 5.11 31 May 2006 lp(1)