Use the cancel command to cancel a print request while it is in the queue or while it is printing. To cancel a request, you need to know the print request id. The request id always includes the name of the printer, a dash, and the number of the print request. When you submit the print request, the request id is displayed. If you do not remember your request id, type lpstat -o and press Return. Only the user who submitted the request, or someone logged in as root or lp can cancel a print request.
To cancel a print request, type the following command.
$ cancel request_id |
In the previous example, request_id is the request id number of the desired print request.
A message informs you that the request is cancelled. The next job in the queue begins printing.
In the following example two print requests are canceled.
$ cancel jetprint-6 fastprint-5 jetprint-6: cancelled fastprint-5: cancelled $ |
You can also cancel just the job that is currently printing (if you submitted it) by typing the printer name in place of the request id.
$ cancel printername |
In the previous example, printername is the name of the printer to which you sent the request.
A message informs you that the request is canceled. The next job in the queue begins printing
In the following example, the current print request has been canceled.
$ cancel jetprint jetprint7: cancelled $ |
Your system administrator can log in as root or lp and cancel the currently printing request by using the printer name as the argument for the cancel command.