xref: /freebsd/usr.sbin/lpr/lprm/lprm.1 (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1.\" Copyright (c) 1983, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)lprm.1	8.1 (Berkeley) 6/6/93
33.\" $FreeBSD$
34.\"
35.Dd June 6, 1993
36.Dt LPRM 1
37.Os
38.Sh NAME
39.Nm lprm
40.Nd remove jobs from the line printer spooling queue
41.Sh SYNOPSIS
42.Nm
43.Op Fl P Ns Ar printer
44.Op Fl
45.Op job # ...\&
46.Op Ar user ...\&
47.Sh DESCRIPTION
48The
49.Nm
50utility will remove a job, or jobs, from a printer's spool queue.
51Since the spooling directory is protected from users, using
52.Nm
53is normally the only method by which a user may remove a job.
54The owner of a job is determined by the user's login name
55and host name on the machine where the
56.Xr lpr 1
57command was invoked.
58.Pp
59Options and arguments:
60.Bl -tag -width indent
61.It Fl P Ns Ar printer
62Specify the queue associated with a specific
63.Ar printer
64(otherwise the default printer is used).
65.It Fl
66If a single
67.Sq Fl
68is given,
69.Nm
70will remove all jobs which a user
71owns.
72If the super-user employs this flag, the spool queue will
73be emptied entirely.
74.It Ar user
75Cause
76.Nm
77to attempt to remove any jobs queued belonging to that user
78(or users).
79This form of invoking
80.Nm
81is useful only to the super-user.
82.It Ar job\ \&#
83A user may dequeue an individual job by specifying its job number.
84This number may be obtained from the
85.Xr lpq 1
86program, e.g.\&
87.Pp
88.Bd -literal -offset indent
89\&% lpq \-l
90
911st:ken				[job #013ucbarpa]
92	(standard input)	100 bytes
93% lprm 13
94.Ed
95.El
96.Pp
97If neither arguments or options are given,
98.Nm
99will delete the currently active job if it is
100owned by the user who invoked
101.Nm .
102.Pp
103The
104.Nm
105utility announces the names of any files it removes and is silent if
106there are no jobs in the queue which match the request list.
107.Pp
108The
109.Nm
110utility will 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 .
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/*/lock/ -compact
130.It Pa /etc/printcap
131Printer characteristics file.
132.It Pa /var/spool/*
133Spooling directories.
134.It Pa /var/spool/*/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``Permission denied" if the user tries to remove files other than his
140own.
141.Sh SEE ALSO
142.Xr lpq 1 ,
143.Xr lpr 1 ,
144.Xr lpd 8
145.Sh HISTORY
146The
147.Nm
148command appeared in
149.Bx 3.0 .
150.Sh BUGS
151Since there are race conditions possible in the update of the lock file,
152the currently active job may be incorrectly identified.
153