1.\" $NetBSD: lpc.8,v 1.17 2008/12/06 02:28:58 jnemeth Exp $ 2.\" 3.\" Copyright (c) 1983, 1991, 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.\" @(#)lpc.8 8.5 (Berkeley) 4/28/95 31.\" 32.Dd April 28, 1995 33.Dt LPC 8 34.Os 35.Sh NAME 36.Nm lpc 37.Nd line printer control program 38.Sh SYNOPSIS 39.Nm 40.Bk -words 41.Oo 42.Ar command 43.Op Ar argument ... 44.Oc 45.Ek 46.Sh DESCRIPTION 47.Nm 48is used by the system administrator to control the 49operation of the line printer system. 50For each line printer configured in 51.Pa /etc/printcap , 52.Nm 53may be used to: 54.Bl -bullet -offset indent 55.It 56disable or enable a printer, 57.It 58disable or enable a printer's spooling queue, 59.It 60rearrange the order of jobs in a spooling queue, 61.It 62find the status of printers, and their associated 63spooling queues and printer daemons. 64.El 65.Pp 66Without any arguments, 67.Nm 68will prompt for commands from the standard input. 69If arguments are supplied, 70.Nm 71interprets the first argument as a command and the remaining 72arguments as parameters to the command. 73The standard input 74may be redirected causing 75.Nm 76to read commands from file. 77Commands may be abbreviated; 78the following is the list of recognized commands. 79.Pp 80.Bl -tag -width Ds -compact 81.It Ic \&? No [ command ... ] 82.It Ic help No [ command ... ] 83Print a short description of each command specified in the argument list, 84or, if no argument is given, a list of the recognized commands. 85.Pp 86.It Ic abort No {\ all\ |\ printer\ } 87Terminate an active spooling daemon on the local host immediately and 88then disable printing (preventing new daemons from being started by 89.Xr lpr 1 ) 90for the specified printers. 91.Pp 92.It Ic clean No {\ all\ |\ printer\ } 93Remove any temporary files, data files, and control files that cannot 94be printed (i.e., do not form a complete printer job) 95from the specified printer queue(s) on the local machine. 96.Pp 97.It Ic disable No {\ all\ |\ printer\ } 98Turn the specified printer queues off. 99This prevents new 100printer jobs from being entered into the queue by 101.Xr lpr 1 . 102.Pp 103.It Ic down No {\ all\ |\ printer\ } message ... 104Turn the specified printer queue off, disable printing and put 105.Em message 106in the printer status file. 107The message doesn't need to be quoted, the 108remaining arguments are treated like 109.Xr echo 1 . 110This is normally used to take a printer down and let others know why 111.Xr lpq 1 112will indicate the printer is down and print the status message. 113.Pp 114.It Ic enable No {\ all\ |\ printer\ } 115Enable spooling on the local queue for the listed printers. 116This will allow 117.Xr lpr 1 118to put new jobs in the spool queue. 119.Pp 120.It Ic exit 121.It Ic quit 122Exit from lpc. 123.Pp 124.It Ic restart No {\ all\ |\ printer\ } 125Attempt to start a new printer daemon. 126This is useful when some abnormal condition causes the daemon to 127die unexpectedly, leaving jobs in the queue. 128.Xr lpq 1 129will report that there is no daemon present when this condition occurs. 130If the user is the super-user, 131try to abort the current daemon first (i.e., kill and restart a stuck daemon). 132.Pp 133.It Ic start No {\ all\ |\ printer\ } 134Enable printing and start a spooling daemon for the listed printers. 135.Pp 136.It Ic status No {\ all\ |\ printer\ } 137Display the status of daemons and queues on the local machine. 138.Pp 139.It Ic stop No {\ all\ |\ printer\ } 140Stop a spooling daemon after the current job completes and disable 141printing. 142.Pp 143.It Ic topq No printer\ [\ jobnum\ ...\ ]\ [\ user\ ...\ ] 144Place the jobs in the order listed at the top of the printer queue. 145.Pp 146.It Ic up No {\ all\ |\ printer\ } 147Enable everything and start a new printer daemon. 148Undoes the effects of 149.Ic down . 150.El 151.Sh FILES 152.Bl -tag -width /var/spool/output/*/lock -compact 153.It Pa /etc/printcap 154printer description file 155.It Pa /var/spool/output/* 156spool directories 157.It Pa /var/spool/output/*/lock 158lock file for queue control 159.El 160.Sh DIAGNOSTICS 161.Bl -tag -width Ds 162.It Sy "?Ambiguous command" 163abbreviation matches more than one command 164.It Sy "?Invalid command" 165no match was found 166.It Sy "?Privileged command" 167you must be a member of group "operator" or root to execute this command 168.El 169.Sh SEE ALSO 170.Xr lpq 1 , 171.Xr lpr 1 , 172.Xr lprm 1 , 173.Xr printcap 5 , 174.Xr lpd 8 175.Sh HISTORY 176The 177.Nm 178command appeared in 179.Bx 4.2 . 180