1.\" $NetBSD: lpq.1,v 1.16 2016/12/21 17:29:22 abhinav 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.Bl -tag -width indent 57.It Fl P 58Specify a particular printer, otherwise the default 59line printer is used (or the value of the 60.Ev PRINTER 61variable in the 62environment). All other arguments supplied are interpreted as user 63names or job numbers to filter out only those jobs of interest. 64.It Fl l 65Information about each of the files comprising the job entry 66is printed. 67Normally, only as much information as will fit on one line is displayed. 68.It Fl a 69Report on the local queues for all printers, 70rather than just the specified printer. 71.It Fl w Ar maxwait 72Specify the maximum time to wait in seconds for remote responses. 73The default is 300 seconds or 5 minutes. 74.El 75.Pp 76For each job submitted (i.e. invocation of 77.Xr lpr 1 ) 78.Nm 79reports the user's name, current rank in the queue, the 80names of files comprising the job, the job identifier (a number which 81may be supplied to 82.Xr lprm 1 83for removing a specific job), and the total size in bytes. 84Job ordering is dependent on 85the algorithm used to scan the spooling directory and is supposed 86to be 87.Tn FIFO 88(First in First Out). 89File names comprising a job may be unavailable 90(when 91.Xr lpr 1 92is used as a sink in a pipeline) in which case the file 93is indicated as ``(standard input)''. 94.Pp 95If 96.Nm 97warns that there is no daemon present (i.e. due to some malfunction), 98the 99.Xr lpc 8 100command can be used to restart the printer daemon. 101.Sh ENVIRONMENT 102If the following environment variable exists, it is used by 103.Nm : 104.Bl -tag -width PRINTER 105.It Ev PRINTER 106Specifies an alternative default printer. 107.El 108.Sh FILES 109.Bl -tag -width /var/spool/output/*/lock -compact 110.It Pa /etc/printcap 111To determine printer characteristics. 112.It Pa /var/spool/output/* 113The spooling directory, as determined from printcap. 114.It Pa /var/spool/output/*/cf* 115Control files specifying jobs. 116.It Pa /var/spool/output/*/lock 117The lock file to obtain the currently active job. 118.El 119.Sh DIAGNOSTICS 120Unable to open various files. The lock file being malformed. Garbage 121files when there is no daemon active, but files in the spooling directory. 122.Sh SEE ALSO 123.Xr lpr 1 , 124.Xr lprm 1 , 125.Xr lpc 8 , 126.Xr lpd 8 127.Sh HISTORY 128.Nm 129appeared in 130.Bx 3 . 131.Sh BUGS 132Due to the dynamic nature of the information in the spooling directory 133.Nm 134may report unreliably. 135Output formatting is sensitive to the line length of the terminal; 136this can result in widely spaced columns. 137