cancel - cancel printer requests (LEGACY)
cancel [ID ...] printer ... cancel ID ...[printer ...]
The cancel utility cancels printer requests that were made by an lp command. The cancellation of a request that is currently printing frees the printer to print its next available request.
Cancelling requests from other users requires appropriate privileges. For each request successfully cancelled by a user who did not submit the request, the submitter may be notified that the request was cancelled.
The cancel utility cannot reliably cancel 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 might not be possible to affect 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.
The following operands are supported:
- A request ID, as returned by lp. Specifying a request ID cancels the associated request even if it is currently printing.
- A printer name (for a complete list of printer names, use lpstat). Specifying a printer cancels the request that is currently printing on that printer.
The following environment variables affect the execution of cancel:
- 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 location of message catalogues for the processing of LC_MESSAGES .
The standard output is a text file containing the status of each cancellation request, in an unspecified format.
Used only for diagnostic messages.
If mail notification is used to inform users of their requests being cancelled by other users, mail files will be modified.
The following exit values are returned:
- Successful completion.
- An error occurred.
lp, lpstat, mailx.