lpstat - report printer status information (LEGACY)
lpstat [-drst] [-a[list]] [-c[list]] [-o[list]] [-p[list]] [-u[list]] [-v[list]] [ID...]
The lpstat utility writes to standard output information about the current status of the printer system.
If no arguments are given, lpstat writes the status of all requests made to lp by the user that are still in the output queue.
The lpstat utility supports the XBD specification, Utility Syntax Guidelines , except the option-arguments are optional and cannot be presented as separate arguments.
Some of the options below can be followed by an optional list that can be in one of two forms: a list of items separated from one another by a comma, or a quoted list of items separated from one another by a comma or one or more blank characters, or combinations of both. See the EXAMPLES section.
The omission of a list following such options causes all information relevant to the option to be written to standard output; for example:
writes the status of all output requests that are still in the output queue.
- Write the acceptance status of destinations for output requests. The list argument is a list of intermixed printer names and class names.
- Write the class names and their members. The list argument is a list of class names.
- Write the system default destination for output requests.
- Write the status of output requests. The list argument is a list of intermixed printer names, class names and request IDs.
- Write the status of printers. The list argument is a list of printer names.
- Write the status of the printer request scheduler.
- Write a status summary, including the status of the printer scheduler, the system default destination, a list of class names and their members and a list of printers and their associated devices.
- Write all status information.
- Write the status of output requests for users. The list argument is a list of login names.
- Write the names of printers and the pathnames of the devices associated with them. The list argument is a list of printer names.
The following operand is supported:
- A request ID, as returned by lp.
The following environment variables affect the execution of lpstat:
- Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
- If set to a non-empty string value, override the values of all the other internationalisation variables.
- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments).
- Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error, and informative messages written to standard output.
- Determine the format of date and time strings output when displaying printer status information with the -a, -o, -p, -t or -u options.
- Determine the location of message catalogues for the processing of LC_MESSAGES .
- Determine the timezone used with date and time strings.
The standard output is a text file containing the information described in the OPTIONS section, in an unspecified format.
Used only for diagnostic messages.
The following exit values are returned:
- Successful completion.
- An error occurred.
The lpstat utility cannot reliably determine the status of print requests in all conceivable circumstances. When the printer is under the control of another operating system or resides on a remote system across a network, it need not be possible to determine the status of the print job after it has left the control of the local operating system. Even on local printers, spooling hardware in the printer may make it appear that the print job has been completed long before the final page is printed.
- Obtain the status of two printers, the pathnames of two printers, a list of all class names and the status of the request named HiPri-33:
lpstat -plaser1,laser4 -v"laser2 laser3" -c HiPri-33
- Obtain user print job status using the obsolescent mixed blank and comma form:
lpstat -u"ddg,gmv, maw"
A version of lpstat that fully supports the XBD specification, Utility Syntax Guidelines may be introduced in a future issue.