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