cancel
cancel is the command that lets you stop print requests from printing.
Requests can be cancelled by (1) using the "printer id" or (2) by specifying the printer name. (And no, you cannot cancel other users print jobs.)
The usual sequence of commands involved in cancelling a print job is something like this:
$ lpstat -t scheduler is running system default destination: laser device for laser: /dev/lp0 laser accepting requests since Tue Feb 9 07:52:24 EST 1993. available. laser-100 tech1 1932 Apr 24 10:33 filtered laser-101 djk1 10004 Apr 24 10:34 filtered laser-102 stu1 2008 Apr 24 10:35 filtered laser-103 stu2 6844 Apr 24 10:35 filtered
(to cancel job "laser-102")
$ cancel laser-102 Request "laser-102" canceled.
Suppose your user id is stu1, and you have 5 print jobs and want to cancel them all, easily.
You could type:
$ cancel laser-101 laser-102 laser-103 laser-104 laser-105 Request "laser-101" canceled. Request "laser-102" canceled. Request "laser-103" canceled. Request "laser-104" canceled. Request "laser-105" canceled.
or, you could just type:
$ cancel -u stu1 Request "laser-101" canceled. Request "laser-102" canceled. Request "laser-103" canceled. Request "laser-104" canceled. Request "laser-105" canceled.
The "-u" option lets you specify a username, rather than the printer id number. This can be very convenient in cases such as this.
Examples of the cancel command
[cancel laser-101]
This command terminates (or cancels) the print request identified as "laser-101".
[cancel -u stu1]
Cancel all of the print jobs that are queued for the user named "stu1".