The lprm command enables users to cancel print requests previously sent with the lpr command. You must first use the lpq command to identify the job number.

Using the -P option will allow you to select a specific printer, if this option is omitted then the default printer is selected.

If a single - is used (lprm -) then all jobs belonging to the user running the command are removed from the queue.

If the job number is specified (which can be found using the lpq command) then only that job number is removed.

Command Format

lprm -P printer [job_number] [user]

Example

$ lprm -P upstairs

system default destination : printer5si
scheduler is running
upstairs-14 marcy 623 Oct 16 10:25 on upstairs
upstairs-12 sally 552 Oct 16 10:28

$ lprm upstairs-12

request "upstairs-12" canceled
$

Use the lprm - command to remove all jobs owned by you.

$ lprm -

request "upstairs-12" canceled
$

Note: Only the superuser can remove a print job sent by another user.