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