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