xref: /netbsd/usr.sbin/lpr/lpq/lpq.1 (revision 6550d01e)
1.\"	$NetBSD: lpq.1,v 1.14 2003/08/07 11:25:29 agc Exp $
2.\"
3.\" Copyright (c) 1983, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)lpq.1	8.2 (Berkeley) 4/28/95
31.\"
32.Dd April 28, 1995
33.Dt LPQ 1
34.Os
35.Sh NAME
36.Nm lpq
37.Nd spool queue examination program
38.Sh SYNOPSIS
39.Nm
40.Op Fl al
41.Op Fl P Ar printer
42.Op Fl w Ar maxwait
43.Op Ar job# ...
44.Op Ar user ...
45.Sh DESCRIPTION
46.Nm
47examines the spooling area used by
48.Xr lpd 8
49for printing files on the line printer, and reports the status of the
50specified jobs or all jobs associated with a user.
51.Nm
52invoked
53without any arguments reports on any jobs currently in the queue.
54.Pp
55Options:
56.Pp
57.Bl -tag -width indent
58.It Fl P
59Specify a particular printer, otherwise the default
60line printer is used (or the value of the
61.Ev PRINTER
62variable in the
63environment). All other arguments supplied are interpreted as user
64names or job numbers to filter out only those jobs of interest.
65.It Fl l
66Information about each of the files comprising the job entry
67is printed.
68Normally, only as much information as will fit on one line is displayed.
69.It Fl a
70Report on the local queues for all printers,
71rather than just the specified printer.
72.It Fl w Ar maxwait
73Specify the maximum time to wait in seconds for remote responses.
74The default is 300 seconds or 5 minutes.
75.El
76.Pp
77For each job submitted (i.e. invocation of
78.Xr lpr 1 )
79.Nm
80reports the user's name, current rank in the queue, the
81names of files comprising the job, the job identifier (a number which
82may be supplied to
83.Xr lprm  1
84for removing a specific job), and the total size in bytes.
85Job ordering is dependent on
86the algorithm used to scan the spooling directory and is supposed
87to be
88.Tn FIFO
89(First in First Out).
90File names comprising a job may be unavailable
91(when
92.Xr lpr  1
93is used as a sink in a pipeline) in which case the file
94is indicated as ``(standard input)''.
95.Pp
96If
97.Nm
98warns that there is no daemon present (i.e. due to some malfunction),
99the
100.Xr lpc  8
101command can be used to restart the printer daemon.
102.Sh ENVIRONMENT
103If the following environment variable exists, it is used by
104.Nm :
105.Bl -tag -width PRINTER
106.It Ev PRINTER
107Specifies an alternative default printer.
108.El
109.Sh FILES
110.Bl -tag -width /var/spool/output/*/lock -compact
111.It Pa /etc/printcap
112To determine printer characteristics.
113.It Pa /var/spool/output/*
114The spooling directory, as determined from printcap.
115.It Pa /var/spool/output/*/cf*
116Control files specifying jobs.
117.It Pa /var/spool/output/*/lock
118The lock file to obtain the currently active job.
119.El
120.Sh DIAGNOSTICS
121Unable to open various files.  The lock file being malformed.  Garbage
122files when there is no daemon active, but files in the spooling directory.
123.Sh SEE ALSO
124.Xr lpr 1 ,
125.Xr lprm 1 ,
126.Xr lpc 8 ,
127.Xr lpd 8
128.Sh HISTORY
129.Nm
130appeared in
131.Bx 3 .
132.Sh BUGS
133Due to the dynamic nature of the information in the spooling directory
134.Nm
135may report unreliably.
136Output formatting is sensitive to the line length of the terminal;
137this can results in widely spaced columns.
138