lpc – Command Line Printer Control Program

Lpc is a command line utility in Linux that controls and manages print jobs on a system. It allows users to view the status of print jobs, pause or resume printing, and remove print jobs from a printer queue. Lpc is a part of the Common Unix Printing System (CUPS) and can be used with any printer that is configured with CUPS.

Overview

The syntax for using lpc command is as follows:

lpc [options] [command] [printer]

Where:

  • options are the various command line options available with lpc.
  • command is the action to be performed on the printer queue, such as start, stop, enable, disable, etc.
  • printer is the name of the printer queue to be managed.

Examples

  1. To view the status of all print jobs on the default printer:
lpc status
  1. To view the status of all print jobs on a specific printer:
lpc status <printer-name>
  1. To remove all print jobs from the default printer:
lpc cancel
  1. To remove a specific print job from a specific printer:
lpc cancel <printer-name> <job-id>
  1. To enable a printer:
lpc enable <printer-name>
  1. To disable a printer:
lpc disable <printer-name>
  1. To start printing on a printer:
lpc start <printer-name>
  1. To stop printing on a printer:
lpc stop <printer-name>

Options

The following table lists the available options for the lpc command:

Option Description
-c Connect to the CUPS server on a remote system.
-d Use a specific CUPS server.
-E Encrypt the connection to the CUPS server.
-U Specify the username to use when connecting to the CUPS server.
-h Display the help information for the lpc command.
-l List all available printers.
-L List all available classes.
-P Specify the default printer to use.
-r Remove a printer or class.
-t Test a printer.
-v Verbose mode.

Troubleshooting Tips

  • If you are unable to manage print jobs using lpc, ensure that the CUPS service is running on your system.
  • If you are unable to connect to a remote CUPS server using lpc, ensure that the CUPS server is running and that the remote system is accessible.
  • If you are unable to remove a printer or class using lpc, ensure that you have the necessary permissions to perform the action.

Notes

  • The lpc command is used for managing print jobs on a single printer. If you need to manage print jobs on multiple printers, use the lpq command instead.
  • The lpc command can only be used by users with administrative privileges.