lpinfo
List available printer or device information
TLDR
List all the currently connected printers
List all the currently installed printer drivers
Search installed printer drivers by make and model
SYNOPSIS
lpinfo [ -E ] [ -h server[:port] ] [ -l ] { -m | -v } [ --device-id device-id ] [ --exclude-schemes schemes ] [ --include-schemes schemes ] [ --lang language ] [ --timeout seconds ]
PARAMETERS
-E
Enables encryption when connecting to the CUPS server.
-h server[:port]
Specifies an alternate CUPS server to connect to. If not specified, the default server (localhost:631) is used.
-l
Provides a long (detailed) listing of the devices or models, showing more attributes and information.
-m
Lists the available printer models and drivers (PPD files). These are the drivers CUPS can use to configure a printer queue.
-v
Lists the available printer device URIs (Uniform Resource Identifiers). These URIs represent discovered printers, whether local or network-based.
--device-id DEVICE_ID
Shows only PPD files that match the specified IEEE 1284 device ID. Useful for identifying compatible drivers for specific hardware.
--exclude-schemes schemes
Excludes specific device URI schemes from the listing (e.g., 'usb', 'dnssd', 'ipp'). Multiple schemes can be separated by commas.
--include-schemes schemes
Includes only specific device URI schemes in the listing (e.g., 'usb', 'dnssd', 'ipp'). Multiple schemes can be separated by commas.
--lang language
Specifies the natural language for the output (e.g., 'en' for English, 'fr' for French).
--timeout seconds
Specifies a timeout in seconds for device discovery operations. This is particularly relevant for network discovery.
DESCRIPTION
The lpinfo command is a command-line utility provided by the Common Unix Printing System (CUPS). Its primary function is to discover and list various types of information pertinent to printing resources, specifically available printer drivers (models) and printer device URIs. This tool is invaluable for system administrators and users alike, enabling them to identify what printers are discoverable on the network, connected locally (e.g., via USB), or which backend drivers (PPD files) are installed and available for use.
By providing options to list either devices or drivers, lpinfo facilitates the setup and configuration of new printers using utilities like lpadmin. It can show network-discovered printers via protocols like Bonjour/mDNS or IPP, and also list local devices connected through various backends. The detailed output helps in understanding the capabilities and connection methods of available printing hardware.
CAVEATS
The lpinfo command relies on the CUPS daemon (cupsd) being active and properly configured to discover devices and drivers. Network discovery capabilities, such as Bonjour/mDNS, depend on the network environment and corresponding services being enabled. The output, especially with the -l option, can be quite verbose, so piping to grep or less might be necessary for specific searches. Access permissions might also affect the visibility of certain devices or drivers if not run as a privileged user.
COMMON USAGE
Here are some common ways to use lpinfo:
To list all available printer device URIs:
lpinfo -v
To list all available printer drivers (PPD files):
lpinfo -m
To list detailed information about discovered devices:
lpinfo -v -l
To list drivers matching a specific device ID (e.g., from a USB printer):
lpinfo -m --device-id 'MFG:HP;MDL:LaserJet 400 Color M451;...'
To list only USB devices:
lpinfo -v --include-schemes usb
BACKEND PROGRAMS
lpinfo relies on CUPS backend programs (for example, /usr/lib/cups/backend/usb, /usr/lib/cups/backend/dnssd, /usr/lib/cups/backend/ipp) to discover devices. When lpinfo -v is executed, it runs these backend programs to enumerate available printers across different interfaces and protocols.
HISTORY
lpinfo is an integral part of the Common Unix Printing System (CUPS), which was initially developed by Michael Sweet at Easy Software Products. CUPS was designed to provide a modern, modular, and extensible printing system for Unix-like operating systems, aiming to replace older, less flexible printing solutions like System V and BSD printing. lpinfo has been a core utility since the early days of CUPS, providing a standardized way to query available printing resources. After its acquisition by Apple Inc. in 2007, CUPS development continued under Apple, and more recently, the project transitioned to the OpenPrinting workgroup of the Linux Foundation, ensuring its continued evolution and maintenance in the open-source community.