lp — Send a file to a printer

Format

lp [–cmsw] [–d dest] [–n number] [–o printer-option] [–t title] [file …]

Description

lp prints one or more input files on a printer. If you do not specify any files on the command line, or if you specify a file name of (dash), lp reads and prints the standard input. The files are printed in the same order that they are specified on the command line.

Note: If you are using the z/OS® Infoprint Server Feature, your system automatically uses that version of the lp command.

Options

–c
Immediately copies the files to be printed. This ensures that the version of the file that exists when the print request is made is the version printed.
–d dest
Specifies dest as the output device. –d takes precedence over the LPDEST environment variable, which in turn takes precedence over the PRINTER environment variable.

dest is a comma-separated list of arguments that is passed to JES. The first item must be the “destination_name”. The destination name can take the form NODE.USER. The second item must be the “class”. The third item must be the “forms”. Not all items must be specified, but the items must be specified in the proper order. The definition of “destination_name”, “class”, and “forms” is defined by JES.

For more information about the dest option, see z/OS MVS JCL Reference.

–m
This option is not implemented.
–n number
Prints number copies of each input file (the default is 1 copy).
–o printer-option
This option is not implemented.
–s
This option is not implemented.
–t
This option is not implemented.
–w
This option is not implemented.

Examples

  1. To send a previously formatted file to a JES printer:
    lp filename
    You can specify more than one file name with the command.
  2. The following prints the file temp.prt using the default printer destination and specifying class c (where c is the locally designated class for secured information):
    lp –d ,c temp.prt
    
    lp –d,c temp.prt
    The parameters on the -d option are positional, so if you omit a destination, you must still include the comma.

Environment variables

lp uses the following environment variables:
LPDEST
Names the output device. This variable takes precedence over PRINTER.
PRINTER
Names the output device if LPDEST is not defined.

Localization

lp uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_CTYPE
  • LC_MESSAGES
  • NLSPATH

See Localization for more information.

Exit values

0
Successful completion
>0
An error occurred

Portability

POSIX.2, X/Open Portability Guide.

The –m, –o, –s, –t, and –w options are extensions to the POSIX standard.