LinuxCommandLibrary

lpc

Control line printer devices

SYNOPSIS

lpc [host]
lpc command [argument ...]

PARAMETERS

abort {all | printer}
    Terminates the current printer daemon and disables the print queue immediately.

clean {all | printer}
    Removes all completed jobs and associated files from the specified print queue.

disable {all | printer}
    Prevents new jobs from being entered into the specified print queue.

down {all | printer} [message]
    Disables the queue, stops the daemon, and sets an optional message displayed to users trying to print.

enable {all | printer}
    Allows new jobs to be entered into the specified print queue.

exit
    Exits the lpc interactive command interpreter.

help [command]
    Displays a list of recognized commands or a short description of a specific command.

quit
    Exits the lpc interactive command interpreter.

restart {all | printer}
    Attempts to restart a printer daemon for the specified printer, useful if it has crashed.

start {all | printer}
    Enables the print queue and starts the printer daemon.

status {all | printer}
    Displays the status of the specified printer or all printers, showing daemon status, queue enabled state, and number of jobs.

stop {all | printer}
    Stops the printer daemon but leaves the queue enabled for new jobs.

topq printer {job_number ... | user ...}
    Moves specified jobs or all jobs from a given user to the top of the queue for immediate printing.

up {all | printer}
    Enables the queue and starts the daemon for the specified printer (the opposite of down).

DESCRIPTION

lpc is a command-line utility used to administer the lpr (line printer) spooling system. It allows a system administrator or authorized user to control various aspects of the printing environment.
Key functions include enabling or disabling printer queues, starting or stopping printer daemons, reordering jobs within a print queue, and querying the status of individual printers or all printers.
While lpr and its related utilities like lpc were standard in BSD-based Unix systems, they have largely been replaced by more modern printing systems like CUPS (Common Unix Printing System) on many Linux distributions.
However, lpc can still be found on systems configured to use the traditional lpr system, often for compatibility or specific legacy hardware. It provides granular control over print jobs and printer availability, making it an essential tool for managing a legacy printing infrastructure.

CAVEATS

The lpc command typically requires root privileges or membership in the lp group to perform administrative tasks. It is primarily associated with the traditional BSD lpr printing system, which has largely been superseded by CUPS on most modern Linux distributions. Its functionality is dependent on the proper configuration and running status of the underlying lpr daemon, and errors can be cryptic if the system is not correctly set up.

INTERACTIVE MODE

When invoked without any arguments, lpc enters an interactive command interpreter mode. This allows users to issue multiple commands consecutively without having to re-execute the lpc command for each operation. This mode is particularly useful for performing several printer management tasks in a single session.

HISTORY

lpc is an integral part of the original BSD lpr printing system, which originated in the Berkeley Software Distribution of Unix. This system was widely adopted in early Unix environments for managing shared line printers.
Over time, more advanced printing systems like CUPS emerged, offering broader support for modern printers, network protocols, and authentication. While CUPS has become the de facto standard on most Linux distributions, lpc and the lpr suite persist in legacy systems or for specific compatibility requirements.
Its usage has declined with the rise of graphical printer administration tools and the widespread adoption of CUPS.

SEE ALSO

lpr(1), lpq(1), lprm(1), pr(1), cupsd(8)

Copied to clipboard