This is a quick command I stumbled upon while looking around the folder that contains all of the binary files Terminal runs on. One of these commands is
cancel, and is design to cancel print jobs from your Mac while in Terminal. This would be very useful for anyone who is building a script or wants a different way of canceling print jobs. This command can also run over a network and can remove print jobs only from certain users.
To cancel your print job open up Terminal and type the following:
This will cancel all prints jobs on your connected Mac. If you have a printer over a network you can use the following command:
cancel -a -h 220.127.116.11:[port]
This will cancel all of the print jobs on the IP address 192.168.0.1 with the required port number.
If you want to cancel selected jobs from certain users simply append, the -u option as follows:
cancel -a -U "James"
This will cancel all jobs by the user James. If your name has multiple words, ensure the name is in quote marks. To find the name that you or any users prints by, select job info from the print queue window.
Finally to view the man page of the cancel command, simply type:
Its note a complicated command
cancel, but may come in useful. If you have any questions or comments, please leave one below.