Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

cancel - cancel line printer requests

&pagelevel(4)&pagelevel

You can use cancel to abort or cancel any of the print jobs that you submitted with the lp command.

Nonprivileged users can abort or cancel only print jobs submitted under their own login names.

Information on print jobs is displayed by the lpstat command.

Syntax


Format 1:cancel[ jobno...] printer...
Format 2:cancel jobno... [printer...]


You must specify a value for at least one of the operands.

jobno

In jobno you specify the job number of a print job. The job number is the number that is reported on standard output when you submit a print job with the lp command. You may specify more than one job number, using blanks to separate them.
If necessary, you can obtain a list of all pending print jobs with the lpstat command. Nonprivileged users can request information only about the status of print jobs submitted under their own login names.
cancel issues a message on standard output to tell you which print jobs have been cancelled or aborted.

printer

In printer you specify the name of a RSO printer or a printer group. You may specify more than one name. Any print job currently running on printer is aborted, and the printer is freed for the next job. cancel issues a message on standard output to tell you which print jobs have been aborted.

You can use lpstat to find out which printers currently have jobs of the own userid running on them.

Error

cancel: printer "G005" was not busy

None of the printers in the printer group that you specified, G005 in this case, had a print job running on it. When you specify a printer group name, you can only terminate a job that is currently printing on a printer in the named group. You cannot use this method to cancel print jobs that have been submitted but are still waiting to be executed. To cancel queued print jobs, you must specify the job number.


cancel: request "TSN-AB35" non existent

The job number you specified in the cancel call, TSN-AB35 in this case, is not the number of an existing print job. Use lpstat to obtain a list of all currently executing and pending print jobs.


UX:cancel: WARNING: "XY" is not a request id or a printer

    Cancel requests by id or by name of printer where printing.

When you called cancel, you specified an argument XY which is neither a job number nor the name of a printer group.

Locale

The following environment variables affect the execution of cancel:

LANG

Provide a default value for the internationalization variables that are unset or null. If LANG is unset of null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

LC_ALL

If set to a non-empty string value, override the values of all the other internationalization variables.

LC_CTYPE

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). LC_CTYPE governs character classes, character conversion (shifting) and the behavior of character classes in regular expressions.

LC_MESSAGES

Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

NLSPATH

Determine the location of message catalogs for the processing of LC_MESSAGES.

Example 1

You inadvertently submit the same print job twice, so you want to cancel the second one.

$ lp test test
request id is TSN-6J1V (test)
request id is TSN-6J1W (test)
$ cancel tsn-6j1w
request “TSN-6J1W“ cancelled

Example 2

Your system has two printer groups, G001 and G002, each of which consists of one printer.

The job currently executing on printer group G001 is to be aborted:

$ cancel G001
request "TSN-1234" cancelled

The job number of the terminated print job was TSN-1234.
The print jobs with job numbers TSN-9WJ7 and TSN-9WAS are to be cancelled:

$ cancel TSN-9WJ7 TSN-9WAS
request "TSN-9WJ7" cancelled
request "TSN-9WAS" cancelled

See also

lp, lpstat