1.\" $OpenBSD: lpq.1,v 1.10 2007/05/31 19:20:25 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: May 31 2007 $ 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 variable exists, it is used by 100.Nm lpq : 101.Bl -tag -width PRINTER 102.It Ev PRINTER 103Specifies an alternate default printer. 104.El 105.Sh FILES 106.Bl -tag -width "/var/spool/output/*/lock" -compact 107.It Pa /etc/printcap 108To determine printer characteristics. 109.It Pa /var/spool/* 110The spooling directory, as determined from printcap. 111.It Pa /var/spool/output/*/cf* 112Control files specifying jobs. 113.It Pa /var/spool/output/*/lock 114The lock file to obtain the currently active job. 115.El 116.Sh DIAGNOSTICS 117Unable to open various files. 118The lock file being malformed. 119Garbage files when there is no daemon active, but files in the 120spooling directory. 121.Sh SEE ALSO 122.Xr lpr 1 , 123.Xr lprm 1 , 124.Xr lpc 8 , 125.Xr lpd 8 126.Sh HISTORY 127.Nm lpq 128appeared in 129.Bx 3 . 130.Sh BUGS 131Due to the dynamic nature of the information in the spooling directory, 132.Nm 133may report unreliably. 134Output formatting is sensitive to the line length of the terminal; 135this can result in widely spaced columns. 136