1.\" $OpenBSD: lprm.1,v 1.9 2007/02/16 13:34:58 jmc Exp $ 2.\" $NetBSD: lprm.1,v 1.10 2002/01/19 03:23:47 wiz Exp $ 3.\" 4.\" Copyright (c) 1983, 1990, 1993 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 3. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.\" @(#)lprm.1 8.1 (Berkeley) 6/6/93 32.\" 33.Dd June 6, 1993 34.Dt LPRM 1 35.Os 36.Sh NAME 37.Nm lprm 38.Nd remove jobs from the line printer spooling queue 39.Sh SYNOPSIS 40.Nm lprm 41.Op Fl 42.Op Fl P Ns Ar printer 43.Oo 44.Op Ar job# Ar ... 45.Op Ar user Ar ... 46.Oc 47.Sh DESCRIPTION 48.Nm lprm 49will remove a job, or jobs, from a printer's spool queue. 50Since the spooling directory is protected from users, using 51.Nm 52is normally the only method by which a user may remove a job. 53The owner of a job is determined by the user's login name 54and host name on the machine where the 55.Xr lpr 1 56command was invoked. 57.Pp 58Options and arguments: 59.Bl -tag -width indent 60.It Fl P Ns Ar printer 61Specify the queue associated with a specific 62.Ar printer 63(otherwise the default printer is used). 64.It Fl 65If a single 66.Dq Fl 67is given, 68.Nm 69will remove all jobs which a user 70owns. 71If the superuser employs this flag, the spool queue will 72be emptied entirely. 73.It Ar user 74Causes 75.Nm 76to attempt to remove any jobs queued belonging to that user (or users). 77This form of invoking 78.Nm 79is useful only to the superuser. 80.It Ar job# 81A user may dequeue an individual job by specifying its job number. 82This number may be obtained from the 83.Xr lpq 1 84program, e.g., 85.Pp 86.Bd -literal -offset indent 87\&% lpq \-l 88 891st:ken [job #013ucbarpa] 90 (standard input) 100 bytes 91% lprm 13 92.Ed 93.El 94.Pp 95If neither arguments or options are given, 96.Nm 97will delete the currently active job if it is 98owned by the user who invoked 99.Nm lprm . 100.Pp 101.Nm lprm 102announces the names of any files it removes and is silent if 103there are no jobs in the queue which match the request list. 104.Pp 105.Nm 106will kill off an active daemon, if necessary, before removing 107any spooling files. 108If a daemon is killed, a new one is 109automatically restarted upon completion of file removals. 110.Sh ENVIRONMENT 111If the following environment variable exists, it is utilized by 112.Nm lprm : 113.Bl -tag -width PRINTER 114.It Ev PRINTER 115If the environment variable 116.Ev PRINTER 117exists, 118and a printer has not been specified with the 119.Fl P 120option, 121the default printer is assumed from 122.Ev PRINTER . 123.El 124.Sh FILES 125.Bl -tag -width /var/spool/output/*/lock/ -compact 126.It Pa /etc/printcap 127Printer characteristics file. 128.It Pa /var/spool/output/* 129Spooling directories. 130.It Pa /var/spool/output/*/lock 131Lock file used to obtain the PID of the current 132daemon and the job number of the currently active job. 133.El 134.Sh DIAGNOSTICS 135.Bl -tag -width Ds 136.It Sy Permission denied 137Printed if the user tries to remove files other than his own. 138.El 139.Sh SEE ALSO 140.Xr lpq 1 , 141.Xr lpr 1 , 142.Xr lpd 8 143.Sh HISTORY 144The 145.Nm lprm 146command appeared in 147.Bx 3.0 . 148.Sh BUGS 149Since there are race conditions possible in the update of the lock file, 150the currently active job may be incorrectly identified. 151