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