Removing print jobs with lprm
Users can remove their own print jobs from the queue with the lprm command. Used alone on the command line, lprm will remove all the user's print jobs from the default printer. To remove jobs from a specific printer, use the -P option, as follows:
To remove all print jobs for the current user, type the following:
The root user can remove all the print jobs for a specific user by indicating that user on the lprm command line. For example, to remove all print jobs for the user named mike, the root user would type the following:
$ lprm mike
To remove an individual print job from the queue, indicate the job number of that print job on the lprm command line. To first find out what the job number is, type the lpq command. Here's what the output of that command may look like:
Printer: [email protected] Queue: 2 printable jobs Server: pid 4134 active Unspooler: pid 4135 active
Status: waiting for subserver to exit at 18:54:05.230 Rank Owner/ID Class Job Files Size Time active [email protected]+13 3 A 133 /home/jake/pr1 467 18:53:49
2 [email protected]+19 7 A 197 /home/jake/mydoc 23948 18:54:05
The output shows two printable jobs waiting in the queue. (In this case, they're not printing because the printer is off.) Under the Job column, you can see the job number associated with each document. To remove the first print job, type the following:
# lprm 133
Continue reading here: Controlling printers with lpc
Was this article helpful?
Readers' Questions
-
david2 months ago
- Reply