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