The lprm Command

If you send a job to a printer and it isn't what you wanted, you can cancel it. This is common in times when you are rushing and you press Print and realize, “I didn't want to do that.” Now, you don't have to be a tree-killing-paper-ream-eating-user, and you can quickly stop that wasteful 1,000-page print job you didn't mean to send. The lprm command enables you to remove items from the printer queue. This is how you use it:

If you need to use lprm, follow these steps:

1.
Use the lpq command to find the job ID number that you want to remove.
2.
Invoke lprm with the following syntax: lprm -P<printer name> <job ID>.

For example, if you wanted to remove job #15 from the queue in the printer pr1, you can type

					>lprm –Ppr1 15
				

To ...

Get SAMS Teach Yourself Unix in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.