start page | rating of books | rating of authors | reviews | copyrights

Unix Power ToolsUnix Power ToolsSearch this book

45.3. Printer Control with lpc

The lpc(8) command, for lpr-style printing setups, is mostly for the superuser. (You may find it in a system directory, like /usr/sbin/lpc.) Everyone can use a few of its commands; this article covers those.

You can type lpc commands at the lpc> prompt; when you're done, type exit (or CTRL-d):

% lpc
lpc> help status
status          show status of daemon and queue
lpc> ...
lpc> exit
%

Or you can type a single lpc command from the shell prompt:

% lpc status imagen
imagen:
        queuing is enabled
        printing is enabled
        no entries
        no daemon present
%

The printer daemon (Section 1.10) watches the queue for jobs that people submit with lpr (Section 45.2). If queueing is disabled (usually by the system administrator), lpr won't accept new jobs.

lpc controls only printers on your local host. lpc won't control printers connected to other hosts, though you can check the queue of jobs (if any) waiting on your local computer for the remote printer.

The commands anyone can use are:

restart [printer]
This tries to start a new printer daemon. Do this if something makes the daemon die while there are still jobs in the queue (lpq or lpc status will tell you this). It's worth trying when the system administrator is gone and the printer doesn't seem to be working. The printer name can be all to restart all printers. The printer name doesn't need an extra P. For example, to specify the foobar printer to lpr, you'd type lpr -Pfoobar. With lpc, use a command like restart foobar.

status [printer]
Shows the status of daemons and queues on the local computer (see the preceding example). The printer name can be all to show all printers.

help [command]
By default, gives a list of lpc commands, including ones for the superuser only. Give it a command name and it explains that command.

exit
Quits from lpc.

-- JP



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.