lpinfo Command in Linux



The lpinfo command in Linux serves as a valuable tool for gaining insights into the printing system. It provides detailed information about the available printers, drivers, and their configurations. By utilizing this command, system administrators and users can effectively manage and troubleshoot printing tasks.

The lpinfo command is a powerful tool used to gather information about printers and printing systems configured on a Linux system, especially those managed by CUPS (Common Unix Printing System). It provides details about available printers, their status, and various configuration options.

Table of Contents

Here is a comprehensive guide to the options available with the lpinfo command −

Understanding lpinfo Command

The lpinfo command is a powerful tool in Linux systems, designed to provide detailed information about printers and printing systems. It's particularly useful for administrators who need to manage and troubleshoot printing configurations. By using the lpinfo command, you can gain valuable insights into the status of your printers, their associated drivers, and other relevant details.

One of the primary uses of lpinfo is to identify available printers on a system. By running lpinfo -v, you can obtain a list of all recognized printers, including their names, locations, and current status. This information is essential for users to select the appropriate printer for their printing jobs.

How to Use lpinfo Command in Linux?

lpinfo can be used to list available printer drivers. This is particularly helpful when you need to install a new printer or update an existing driver. By running lpinfo -m, you can view a list of all supported printer models and their corresponding drivers.

Basic Usage

The lpinfo command is a powerful tool for managing printing systems in Linux, specifically those using the Common Unix Printing System (CUPS). It provides information about available printers, drivers, and other printing-related details −

lpinfo
lpinfo Command in Linux1

This command, without any options, will provide a brief overview of the printing system, including the CUPS version and the server's hostname.

lpinfo Command Options

Options Description
-E Forces encryption when connecting to the CUPS server.
-l Shows a long listing of devices or drivers.
-h server[:port] Select an alternate CUPS server.
--device-id device-id-string Specifies the IEEE-1284 device ID to match when listing drivers.
--exclude-schemes scheme-list Excludes specific device or PPD schemes from the output.
--include-schemes scheme-list: Includes only specific device or PPD schemes in the output.

Common Use Cases and Options − To filter the output based on specific criteria, you can use options like --device-id, --exclude-schemes, and --include-schemes. These options allow you to narrow down the list of printers or drivers to those that meet your specific requirements.

Examples of lpinfo Command in Linux

Listing Available Printers

This option lists all available printers connected to the system. The output will typically include the printer's name, description, location, and other relevant information.

lpinfo -v
lpinfo Command in Linux2

Listing Available Printer Drivers

This option lists all available printer drivers installed on the system. These drivers are used to translate print jobs into a format that specific printers can understand.

lpinfo -m
lpinfo Command in Linux3

Getting Detailed Information About a Specific Printer

This will provide more detailed information about the printer, such as its URI, PPD file, and current status.

lpinfo -v <printer_name>

Replace <printer_name> with the actual name of the printer.

Getting Information About a Specific Printer Driver

This will provide information about the driver's capabilities and supported printer models.

lpinfo -m <driver_name>

Replace <driver_name> with the actual name of the driver.

Checking the Status of a Print Job

This will provide information about the job's status, such as whether it's pending, printing, or completed.

lpinfo -j <job_id>

Replace <job_id> with the ID of the print job you want to check.

Lists all available printers

lpinfo -v
lpinfo Command in Linux4

Lists all available printer drivers

The lpinfo command offers a variety of options to customize its output. For example, the -l option provides a long listing, including detailed information about each printer or driver. This information can be useful for troubleshooting specific printer issues −

lpinfo -m
lpinfo Command in Linux5

Provide a long lasting

Provides a long listing, including detailed information about each printer or driver.

lpinfo -lv
lpinfo Command in Linux6

Forces encryption

Forces encryption when connecting to the CUPS server −

lpinfo -E -v
lpinfo Command in Linux7

Specifies an alternate CUPS

Specifies an alternate CUPS server to query.

lpinfo -h print-server.example.com -v
lpinfo Command in Linux8

Filters the list of drivers

Filters the list of drivers based on a specific IEEE-1284 device ID via --device-id device-id-string −

lpinfo --device-id "HP LaserJet 1020" -m
lpinfo Command in Linux9

Excludes specific device

Excludes specific device or PPD schemes from the output via --exclude-schemes scheme-list −

lpinfo --exclude-schemes file,usb -v
lpinfo Command in Linux10

Includes only specific device

Includes only specific device or PPD schemes in the output via --include-schemes scheme-list −

lpinfo --include-schemes file -m
lpinfo Command in Linux11

Filters the list of drivers

Filters the list of drivers based on a specific language locale via --language locale.

lpinfo --language en_US -m
lpinfo Command in Linux12

Filters the list of drivers

Filters the list of drivers based on a specific make and model via --make-and-model name −

lpinfo --make-and-model "HP LaserJet" -m
lpinfo Command in Linux13

Filters the list of drivers

Filters the list of drivers based on a specific product name via --product name −

lpinfo --product "HP LaserJet 1020" -m
lpinfo Command in Linux14

Sets a timeout

Sets a timeout for the lpinfo -v command via --timeout seconds −

lpinfo --timeout 5 -v
lpinfo Command in Linux15

By effectively using these options, you can gain valuable insights into your printing environment, identify available printers, and troubleshoot any printing-related issues.

Conclusion

The lpinfo command offers several key functionalities to assist users in their printing endeavors. It can be used to list the available printers connected to the system, providing information such as their names, locations, and current status. Additionally, lpinfo can display information about the installed printer drivers, including their capabilities and supported features. This information is crucial for ensuring compatibility and optimal performance when printing various document types.

By effectively using the lpinfo command and its various options, you can gain valuable insights into your printing system, troubleshoot issues, and optimize your printing workflow.

Advertisements