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
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.
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.
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.
|
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:
The job number of the terminated print job was TSN-1234.
|
See also
lp, lpstat |