lprrm

remove jobs from the line printer spooling queue

Syntax:

lprrm [-Pprinter] [-] [jobnum ...] [user ...]

Options:

-Pprinter
Specify the queue associated with a specific printer; otherwise, the default printer is used.
-
If a single dash (-) is given, lprrm will remove all the jobs a user owns. If the superuser employs this flag, the entire spool queue will be emptied.
jobnum
A user may dequeue an individual job by specifying its job number. This number may be obtained from the lprq utility.
user
Causes lprrm to attempt to remove any jobs queued belonging to that user (or users). This form of invoking lprrm is useful only to the superuser.

Description:

The lprrm utility will remove a job(s) from a printer's spool queue. Since the spooling directory itself is protected from users, lprrm is normally the only recourse a user has to remove a job. The job's owner is determined by the user's login name and hostname on the machine where the lpr command was invoked.

Note that if no arguments or options are given, lprrm will delete the currently active job if it's owned by the user who invoked the command.

The lprrm utility announces the names of any files it removes and is silent if the queue contains no jobs that match the request list.

The utility will kill off an active daemon if necessary before removing any spooling files. If a daemon is killed, a new one is automatically restarted upon completion of file removals.

Files:

/etc/printcap
Determines printer characteristics.

Environment variables:

If the following environment variable exists, lprq uses it:

PRINTER
Specifies an alternate default printer.

Errors:

``Permission denied''
Displays when the user tries to remove files other than his own.

Caveats:

Since there are race conditions possible in the update of the lock file, the currently active job may be incorrectly identified.

See also:

lpr, lprc, lprq, lpd