6001 strcat(9f) needs a manpage
[unleashed.git] / usr / src / man / man1 / lp.1
blobd24e3b07a04aad8430a5d69cd03f70d6376a628d
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
4 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
6 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
8 .\"  This notice shall appear on any product containing this material.
9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
12 .TH LP 1 "May 31, 2006"
13 .SH NAME
14 lp \- submit print request
15 .SH SYNOPSIS
16 .LP
17 .nf
18 \fBlp\fR [\fB-c\fR] [\fB-m\fR] [\fB-p\fR] [\fB-s\fR] [\fB-w\fR] [\fB-d\fR \fIdestination\fR] [\fB-f\fR \fIform-name\fR]
19      [\fB-H\fR \fIspecial-handling\fR] [\fB-n\fR \fInumber\fR] [\fB-o\fR \fIoption\fR]
20      [\fB-P\fR \fIpage-list\fR] [\fB-q\fR \fIpriority-level\fR]
21      [\fB-S\fR \fIcharacter-set\fR | \fIprint-wheel\fR] [\fB-t\fR \fItitle\fR]
22      [\fB-T\fR \fIcontent-type\fR [\fB-r\fR]] [\fB-y\fR \fImode-list\fR] [\fIfile\fR]...
23 .fi
25 .LP
26 .nf
27 \fBlp\fR \fB-i\fR \fIrequest-ID\fR... [\fB-c\fR] [\fB-m\fR] [\fB-p\fR] [\fB-s\fR] [\fB-w\fR]
28      [\fB-d\fR \fIdestination\fR] [\fB-f\fR \fIform-name\fR] [\fB-H\fR \fIspecial-handling\fR]
29      [\fB-n\fR \fInumber\fR] [\fB-o\fR \fIoption\fR] [\fB-P\fR \fIpage-list\fR]
30      [\fB-q\fR \fIpriority-level\fR] [\fB-S\fR \fIcharacter-set\fR | \fIprint-wheel\fR]
31      [\fB-t\fR \fItitle\fR] [\fB-T\fR \fIcontent-type\fR [\fB-r\fR]] [\fB-y\fR \fImode-list\fR]
32 .fi
34 .SH DESCRIPTION
35 .sp
36 .LP
37 The \fBlp\fR utility submits print requests to a destination. There are two
38 formats of the \fBlp\fR command.
39 .sp
40 .LP
41 The first form of \fBlp\fR prints files (\fIfile\fR) and associated information
42 (collectively called a \fIprint request\fR). If \fIfile\fR is not specified,
43 \fBlp\fR assumes the standard input. Use a hyphen (\fB\(mi\fR) with \fIfile\fR
44 to specify the standard input. Files are printed in the order in which they
45 appear on the command line.
46 .sp
47 .LP
48 The second form of \fBlp\fR changes print request options. This form of
49 \fBlp\fR can only be used with print services and protocols that support job
50 modification. The LP print service allows print requests to be modified when
51 they are in a queue local to the system that the lp commands was executed on.
52 The Internet Print Protocol (IPP) allows job modification on remote ipp print
53 services.
54 .sp
55 .LP
56 The print request identified by \fIrequest-ID\fR is changed according to the
57 printing options specified. The printing options available are the same as
58 those with the first form of the \fBlp\fR. If the request has finished printing
59 when the \fBlp\fR command is executed, the change is rejected. If the request
60 is in the process of printing, it is stopped and restarted from the beginning
61 (unless the \fB-P\fR option has been given).
62 .sp
63 .LP
64 The print client commands locate destination information using the "printers"
65 database in the name service switch. See \fBnsswitch.conf\fR(4),
66 \fBprinters\fR(4), and \fBprinters.conf\fR(4) for details.
67 .SH OPTIONS
68 .sp
69 .LP
70 Printers that have a 4.\fIx\fR or \fBBSD-based print server\fR are not
71 configured to handle \fBBSD\fR protocol extensions. \fBlp\fR handles print
72 requests sent to such destinations differently (see NOTES).
73 .sp
74 .LP
75 The following options are supported:
76 .sp
77 .ne 2
78 .na
79 \fB\fB-c\fR\fR
80 .ad
81 .RS 23n
82 Copies \fIfile\fR before printing.
83 .sp
84 Unless \fB-c\fR is specified, users should not remove any \fIfile\fR before the
85 print request has completely printed. Changes made to \fIfile\fR after the
86 print request is made but before it is printed might be reflected in the
87 printed output. \fIfile\fR is linked (as opposed to copied).
88 .RE
90 .sp
91 .ne 2
92 .na
93 \fB\fB-d\fR \fIdestination\fR\fR
94 .ad
95 .RS 23n
96 Prints \fIfile\fR on a specific destination. The \fB-d\fR option is used to set
97 the destination only when the job is first created. (\fBNote:\fR To move
98 existing jobs to a different destination, see \fBlpmove\fR(1M).)
99 \fIdestination\fR can be either a printer or a class of printers (see
100 \fBlpadmin\fR(1M)). Specify \fIdestination\fR using atomic, URI-style
101 (\fIscheme\fR://\fIendpoint\fR), or POSIX-style
102 (\fIserver\fR\fB:\fR\fIdestination\fR) names. See \fBprinters.conf\fR(4) for
103 more information.
107 .ne 2
109 \fB\fB-f\fR \fIform-name\fR\fR
111 .RS 23n
112 Prints \fIfile\fR on \fIform-name\fR. The \fBLP\fR print service ensures that
113 the form is mounted on the printer. The print request is rejected if the
114 printer does not support \fIform-name\fR, if \fIform-name\fR is not defined for
115 the system, or if the user is not allowed to use \fIform-name\fR (see
116 \fBlpforms\fR(1M)).
120 .ne 2
122 \fB\fB-H\fR \fIspecial-handling\fR\fR
124 .RS 23n
125 Prints the print request according to the value of \fIspecial-handling\fR. The
126 following \fIspecial-handling\fR values are acceptable:
128 .ne 2
130 \fB\fBhold\fR\fR
132 .RS 13n
133 Do not print the print request until notified. If printing has already begun,
134 stop it. Other print requests are placed ahead of a request that has been put
135 on hold (\fIheld print request\fR) until the print request is resumed.
139 .ne 2
141 \fB\fBresume\fR\fR
143 .RS 13n
144 Resume a held print request. If the print request had begun to print when held,
145 it is the next print request printed, unless it is superseded by an
146 \fIimmediate\fR print request.
150 .ne 2
152 \fB\fBimmediate\fR\fR
154 .RS 13n
155 Print the print request next. If more than one print request is assigned, the
156 most recent print request is printed next. If a print request is currently
157 printing on the desired printer, a \fBhold\fR request must be issued to allow
158 the immediate request to print. The \fBimmediate\fR request is only available
159 to \fBLP\fR administrators.
165 .ne 2
167 \fB\fB-i\fR \fIrequest-ID\fR\fR
169 .RS 23n
170 Changes options for the print request identified by \fIrequest-ID\fR. There
171 must be a space between \fB-i\fR and \fIrequest-ID\fR.
173 This option applies to jobs that are in a local queue on a print server. This
174 also applies to remote queues on when the remote print server supports IPP with
175 job modification.
179 .ne 2
181 \fB\fB-m\fR\fR
183 .RS 23n
184 Sends mail after \fIfile\fR has printed (see \fBmail\fR(1)). By default, no
185 mail is sent upon normal completion of a print request.
189 .ne 2
191 \fB\fB-n\fR \fInumber\fR\fR
193 .RS 23n
194 Prints a specific number of copies of \fIfile\fR. Specify \fInumber\fR as a
195 digit. The default for \fInumber\fR is \fB1\fR.
199 .ne 2
201 \fB\fB-o\fR \fIoption\fR\fR
203 .RS 23n
204 Specifies printer-dependent \fIoptions\fR. Specify several options by
205 specifying \fB-o\fR \fIoption\fR multiple times (\fB-o\fR \fIoption\fR \fB-o\fR
206 \fIoption\fR \fB-o\fR \fIoption\fR ). Printer-dependent options can also be
207 specified using the \fB-o\fR keyletter once, followed by a list of options
208 enclosed in double quotes (\fB-o\fR"\fIoption\fR \fIoption option\fR").
210 \fIoption\fRs take the following forms:
212 .ne 2
214 \fB\fIkey\fR\fB=\fR\fIvalue\fR\fR
216 .RS 13n
217 Associates information with the request for use by the backend print service.
218 The keys and values that can be used are specific to the backend print service
219 and queue configuration.
223 .ne 2
225 \fB\fB[no]key\fR\fR
227 .RS 13n
228  Associates boolean information with the request for use by the backend print
229 service. The keys that can be used are specific to the backend print service
230 and queue configuration.
233 The following options are commonly used with the LP print service:
235 .ne 2
237 \fB\fBnobanner\fR\fR
239 .sp .6
240 .RS 4n
241 Does not print a banner page with the request. This option can be disallowed by
242 the \fBLP\fR administrator.
244 On a system that is configured with Trusted Extensions, use of this option
245 requires the \fBsolaris.print.nobanner\fR authorization.
249 .ne 2
251 \fB\fBnofilebreak\fR\fR
253 .sp .6
254 .RS 4n
255 Prints multiple files without inserting a form feed between them.
259 .ne 2
261 \fB\fBnolabels\fR\fR
263 .sp .6
264 .RS 4n
265 On a system that is configured with Trusted Extensions, specifies suppression
266 of page header and footer labels. Use of this option requires the
267 \fBsolaris.print.unlabeled\fR authorization.
271 .ne 2
273 \fB\fBlength=\fR\fInumber\fR\fBi\fR | \fInumber\fR\fBc\fR | \fInumber\fR\fR
275 .sp .6
276 .RS 4n
277 Prints the print request with pages of a specific length in inches,
278 centimeters, or number of lines. Append the letter \fBi\fR for inches or
279 \fBc\fR for centimenters to \fInumber\fR. Indicate the number of lines by
280 specifying \fInumber\fR alone. \fBlength=66\fR indicates a page length of
281 \fB66\fR lines. \fBlength=11i\fR indicates a page length of \fB11\fR inches.
282 \fBlength=27.94c\fR indicates a page length of \fB27.94\fR centimeters.
284 This option can not be used with the \fB-f\fR option.
288 .ne 2
290 \fB\fBwidth=\fR\fInumber\fR\fBi\fR | \fInumber\fR\fBc\fR | \fInumber\fR\fR
292 .sp .6
293 .RS 4n
294 Prints the print request with pages of a specific width in inches, centimeters,
295 or number of columns. Append the letter \fBi\fR for inches or \fBc\fR for
296 centimeters to \fInumber\fR. Indicate the number of columns by specifying
297 \fInumber\fR alone. \fBwidth=65\fR indicates a page width of \fB65\fR columns.
298 \fBwidth=6.5i\fR indicates a page width of \fB6.5\fR inches. \fBwidth=10c\fR
299 indicates a page width of \fB10\fR centimeters.
301 This option can not be used with the \fB-f\fR option.
305 .ne 2
307 \fB\fBlpi=\fR\fInumber\fR\fR
309 .sp .6
310 .RS 4n
311 Prints the print request with the line pitch set to \fInumber\fR lines in an
312 inch. Use \fInumber\fR to specify the number of lines in an inch.
314 This option can not be used with the \fB-f\fR option.
318 .ne 2
320 \fB\fBcpi=\fR\fIn\fR|\fBpica\fR|\fBelite\fR|\fBcompressed\fR\fR
322 .sp .6
323 .RS 4n
324 Prints the print request with the character pitch set to \fInumber\fR
325 characters in an inch. Use \fInumber\fR to specify the number of characters in
326 an inch. Use \fBpica\fR to set character pitch to pica (\fB10\fR characters per
327 inch), or \fBelite\fR to set character pitch to elite (\fB12\fR characters per
328 inch) Use \fBcompressed\fR to set character pitch to as many characters as the
329 printer can handle. There is no standard number of characters per inch for all
330 printers; see the \fBterminfo\fR database (see \fBterminfo\fR(4)) for the
331 default character pitch for your printer. This option can not be used with the
332 \fB-f\fR option.
336 .ne 2
338 \fB\fBstty=\fR\fIstty-option-list\fR\fR
340 .sp .6
341 .RS 4n
342 Prints the request using a list of options valid for the \fBstty\fR command
343 (see \fBstty\fR(1). Enclose the list in single quotes (\fB`'\fR) if it contains
344 blanks.
350 .ne 2
352 \fB\fB-P\fR \fIpage-list\fR\fR
354 .RS 23n
355 Prints the pages specified in \fIpage-list\fR in ascending order. Specify
356 \fIpage-list\fR as a of range of numbers, single page number, or a combination
357 of both.
359 The \fB-P\fR option can only be used if there is a filter available to handle
360 it; otherwise, the print request is rejected.
364 .ne 2
366 \fB\fB-p\fR\fR
368 .RS 23n
369 Enables notification on completion of the print request. Delivery of the
370 notification is dependent on additional software.
374 .ne 2
376 \fB\fB-q\fR \fIpriority-level\fR\fR
378 .RS 23n
379 Assigns the print request a priority in the print queue. Specify
380 \fIpriority-level\fR as an integer between from \fB0\fR and \fB39\fR. Use
381 \fB0\fR to indicate the highest priority; \fB39\fR to indicate the lowest
382 priority. If no priority is specified, the default priority for a print service
383 is assigned by the \fBLP\fR administrator. The \fBLP\fR administrator can also
384 assign a default priority to individual users.
388 .ne 2
390 \fB\fB-s\fR\fR
392 .RS 23n
393 Suppresses the display of messages sent from \fBlp\fR.
397 .ne 2
399 \fB\fB-S\fR \fIcharacter-set\fR \fB|\fR\fR
403 \fB\fB-S\fR \fIprint-wheel\fR\fR
405 .RS 23n
406 Prints the request using the \fIcharacter-set\fR or \fIprint-wheel\fR. If a
407 form was requested and requires a character set or print wheel other than the
408 one specified with the \fB-S\fR option, the request is rejected. Printers using
409 mountable print wheels or font cartridges use the print wheel or font cartridge
410 mounted at the time of the print request, unless the \fB-S\fR option is
411 specified.
413 Printers Using Print Wheels: If \fBprint\fR \fIwheel\fR is not one listed by
414 the \fBLP\fR administrator as acceptable for the printer the request is
415 rejected unless the print wheel is already mounted on the printer.
417 Printers Using Selectable or Programmable Character Sets: If the \fB-S\fR
418 option is not specified, \fBlp\fR uses the standard character set. If
419 \fIcharacter-set\fR is not defined in the \fBterminfo\fR database for the
420 printer (see \fBterminfo\fR(4)), or is not an alias defined by the \fBLP\fR
421 administrator, the request is rejected.
425 .ne 2
427 \fB\fB-t\fR \fItitle\fR\fR
429 .RS 23n
430 Prints a title on the banner page of the output. Enclose \fItitle\fR in quotes
431 if it contains blanks. If \fItitle\fR is not not specified, the name of the
432 file is printed on the banner page.
436 .ne 2
438 \fB\fB\fR\fB-T\fR\fIcontent-type\fR [\fB-r\fR]\fR
440 .RS 23n
441 Prints the request on a printer that can support the specified
442 \fIcontent-type\fR. If no printer accepts this type directly, a filter is used
443 to convert the content into an acceptable type. If the \fB-r\fR option is
444 specified, a filter is not used. If \fB-r\fR is specified, and no printer
445 accepts the \fIcontent-type\fR directly, the request is rejected. If the
446 \fIcontent-type\fR is not acceptable to any printer, either directly or with a
447 filter, the request is rejected.
451 .ne 2
453 \fB\fB-w\fR\fR
455 .RS 23n
456 Writes a message on the user's terminal after the \fIfile\fRs have been
457 printed. If the user is not logged in, then mail is sent instead.
461 .ne 2
463 \fB\fB-y\fR \fImode-list\fR\fR
465 .RS 23n
466 Prints the request according to the printing modes listed in \fImode-list\fR.
467 The allowed values for \fImode-list\fR are locally defined.
469 This option can be used only if there is a filter available to handle it;
470 otherwise, the print request is rejected.
473 .SH OPERANDS
476 The following operand is supported:
478 .ne 2
480 \fB\fIfile\fR\fR
482 .RS 8n
483 The name of the file to be printed. Specify \fIfile\fR as a pathname or as a
484 hyphen (\fB\(mi\fR) to indicate the standard input. If \fIfile\fR is not
485 specified, \fBlp\fR uses the standard input.
488 .SH USAGE
491 See \fBlargefile\fR(5) for the description of the behavior of \fBlp\fR when
492 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
493 .SH ENVIRONMENT VARIABLES
496 See \fBenviron\fR(5) for descriptions of the following environment variables
497 that affect the execution of \fBlp\fR: \fBLANG\fR, \fBLC_ALL\fR,
498 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBNLSPATH\fR, and \fBPATH\fR.
500 .ne 2
502 \fB\fBLC_TIME\fR\fR
504 .RS 11n
505 Determine the format and contents of date and time strings displayed in the
506 \fBlp\fR banner page, if any.
510 .ne 2
512 \fB\fBLPDEST\fR\fR
514 .RS 11n
515 Determine the destination. If the \fBLPDEST\fR environment variable is not set,
516 the \fBPRINTER\fR environment variable shall be used. The \fB-d\fR \fIdest\fR
517 option takes precedence over \fBLPDEST\fR. Results are undefined when \fB-d\fR
518 is not specified and \fBLPDEST\fR contains a value that is not a valid
519 destination name.
523 .ne 2
525 \fB\fBPRINTER\fR\fR
527 .RS 11n
528 Determine the output device or destination. If the \fBLPDEST\fR and
529 \fBPRINTER\fR environment variables are not set, an unspecified output device
530 is used. The \fB-d\fR \fIdest\fR option and the \fBLPDEST\fR environment
531 variable shall take precedence over \fBPRINTER\fR. Results are undefined when
532 \fB-d\fR is not specified, \fBLPDEST\fR is unset, and \fBPRINTER\fR contains a
533 value that is not a valid device or destination name.
537 .ne 2
539 \fB\fBTZ\fR\fR
541 .RS 11n
542 Determine the timezone used to calculate date and time strings displayed in the
543 \fBlp\fR banner page, if any. If \fBTZ\fR is unset or null, an unspecified
544 default timezone shall be used.
547 .SH EXIT STATUS
550 The following exit values are returned:
552 .ne 2
554 \fB\fB0\fR\fR
556 .RS 12n
557 Successful completion.
561 .ne 2
563 \fBnon-zero\fR
565 .RS 12n
566 An error occurred.
569 .SH FILES
571 .ne 2
573 \fB\fB/etc/printers.conf\fR\fR
575 .RS 24n
576 System printer configuration database
580 .ne 2
582 \fB\fB$HOME/.printers\fR\fR
584 .RS 24n
585 User-configurable printer database
589 .ne 2
591 \fB\fBou=printers\fR\fR
593 .RS 24n
594 LDAP version of \fB/etc/printers.conf\fR
598 .ne 2
600 \fB\fBprinters.conf.byname\fR\fR
602 .RS 24n
603 \fBNIS\fR version of \fB/etc/printers.conf\fR
607 .ne 2
609 \fB\fBprinters.org_dir\fR\fR
611 .RS 24n
612 \fBNIS+\fR version of \fB/etc/printers.conf\fR
615 .SH ATTRIBUTES
618 See \fBattributes\fR(5) for descriptions of the following attributes:
623 box;
624 c | c
625 l | l .
626 ATTRIBUTE TYPE  ATTRIBUTE VALUE
628 CSI     Enabled. See \fBNOTES\fR.
630 Interface Stability     Standard
633 .SH SEE ALSO
636 \fBcancel\fR(1), \fBenable\fR(1), \fBlpq\fR(1B), \fBlpr\fR(1B), \fBlprm\fR(1B),
637 \fBlpstat\fR(1), \fBmail\fR(1), \fBpostprint\fR(1), \fBpr\fR(1), \fBstty\fR(1),
638 \fBaccept\fR(1M), \fBlpadmin\fR(1M), \fBlpfilter\fR(1M), \fBlpforms\fR(1M),
639 \fBlpmove\fR(1M), \fBlpsched\fR(1M), \fBlpshut\fR(1M), \fBlpsystem\fR(1M),
640 \fBlpusers\fR(1M), \fBnsswitch.conf\fR(4), \fBprinters\fR(4),
641 \fBprinters.conf\fR(4), \fBterminfo\fR(4), \fBattributes\fR(5),
642 \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
643 .SH NOTES
646 \fBCSI\fR-capability assumes that printer names are composed of \fBASCII\fR
647 characters.
650 Print jobs are assumed to contain one type of data. That type of data is either
651 specified on the command line or autodetected (simple, PostScript) based on the
652 contents of the first file in the job.
655 When using the BSD printing protocol to send print requests to a remote print
656 service, functionality is limited.
659 Printers that have a 4.\fIx\fR or BSD-based print server are not configured to
660 handle BSD protocol extensions. \fBlp\fR handles print requests sent to such
661 printers in the following ways:
662 .RS +4
665 Print requests with more than 52 filenames are truncated to 52 files.
667 .RS +4
670 The \fB-f\fR, \fB-H\fR, \fB-o\fR, \fB-P\fR, \fB-p\fR, \fB-q\fR, \fB-S\fR,
671 \fB-T\fR, and \fB-y\fR options might require a protocol extension to pass to a
672 print server. If \fBlp\fR cannot handle the print request, it displays a
673 warning message.
675 \fBLP\fR administrators enable protocol extensions by setting a printer's
676 \fBprinter-uri-supported\fR (or \fBbsdaddr\fR) entry in
677 \fB/etc/printers.conf\fR. Changing the \fBprinter-uri-supported\fR entry in
678 \fB/etc/printers.conf\fR to:
680 .in +2
682 \fBprinter-uri-supported=lpd\e://\fR\fIserver\fR\fB/\fR\fIprinters\fR\fB/\fR\fIdestination\fR\fB#Solaris\fR
684 .in -2
688 .in +2
690 \fBbsdaddr=\fR\fIserver\fR\fB,\fR\fIdestination\fR\fB,Solaris\fR
692 .in -2
695 Adding \fBSolaris\fR to either of these values causes the \fBlp\fR command to
696 generate a set of BSD print protocol extensions that can be processed by a
697 Solaris print server.
701 As a result of several limitations in the BSD print protocol, it is recommended
702 that the IPP protocol be used for communication with print servers.
705 When IPP is in use, the user is prompted for a passphrase if the remote print
706 service is configured to require authentication.