xref: /freebsd/usr.sbin/lpr/lpq/lpq.1 (revision 7bd6fde3)
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.\"     @(#)lpq.1	8.2 (Berkeley) 4/28/95
33.\" $FreeBSD$
34.\"
35.Dd April 28, 1995
36.Dt LPQ 1
37.Os
38.Sh NAME
39.Nm lpq
40.Nd spool queue examination program
41.Sh SYNOPSIS
42.Nm
43.Op Fl a
44.Op Fl l
45.Op Fl P Ns Ar printer
46.Op job # ...\&
47.Op user ...\&
48.Sh DESCRIPTION
49The
50.Nm
51utility examines the spooling area used by
52.Xr lpd 8
53for printing files on the line printer, and reports the status of the
54specified jobs or all jobs associated with a user.
55The
56.Nm
57utility invoked
58without any arguments reports on any jobs currently in the queue.
59.Pp
60Options:
61.Pp
62.Bl -tag -width indent
63.It Fl P
64Specify a particular printer, otherwise the default
65line printer is used (or the value of the
66.Ev PRINTER
67variable in the
68environment).
69All other arguments supplied are interpreted as user
70names or job numbers to filter out only those jobs of interest.
71.It Fl l
72Information about each of the files comprising the job entry
73is printed.
74Normally, only as much information as will fit on one line is displayed.
75.It Fl a
76Report on the local queues for all printers,
77rather than just the specified printer.
78.El
79.Pp
80For each job submitted (i.e., invocation of
81.Xr lpr 1 )
82.Nm
83reports the user's name, current rank in the queue, the
84names of files comprising the job, the job identifier (a number which
85may be supplied to
86.Xr lprm 1
87for removing a specific job), and the total size in bytes.
88Job ordering is dependent on
89the algorithm used to scan the spooling directory and is supposed
90to be
91.Tn FIFO
92(First in First Out).
93File names comprising a job may be unavailable
94(when
95.Xr lpr 1
96is used as a sink in a pipeline) in which case the file
97is indicated as ``(standard input)''.
98.Pp
99If
100.Nm
101warns that there is no daemon present (i.e., due to some malfunction),
102the
103.Xr lpc 8
104command can be used to restart the printer daemon.
105.Sh ENVIRONMENT
106If the following environment variable exists, it is used by
107.Nm :
108.Bl -tag -width PRINTER
109.It Ev PRINTER
110Specifies an alternate default printer.
111.El
112.Sh FILES
113.Bl -tag -width "/var/spool/*/lock" -compact
114.It Pa /etc/printcap
115To determine printer characteristics.
116.It Pa /var/spool/*
117The spooling directory, as determined from printcap.
118.It Pa /var/spool/*/cf*
119Control files specifying jobs.
120.It Pa /var/spool/*/lock
121The lock file to obtain the currently active job.
122.El
123.Sh DIAGNOSTICS
124Unable to open various files.
125The lock file being malformed.
126Garbage
127files when there is no daemon active, but files in the spooling directory.
128.Sh SEE ALSO
129.Xr lpr 1 ,
130.Xr lprm 1 ,
131.Xr lpc 8 ,
132.Xr lpd 8
133.Sh HISTORY
134A
135.Nm
136utility appeared in
137.Bx 3 .
138.Sh BUGS
139Due to the dynamic nature of the information in the spooling directory
140.Nm
141may report unreliably.
142Output formatting is sensitive to the line length of the terminal;
143this can results in widely spaced columns.
144