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