LinuxCommandLibrary

hp-query

Query HP printer/scanner device information

SYNOPSIS

hp-query [OPTION...] [DEVICE_URI]

PARAMETERS

-d , --device=
    Specifies the URI of the HP device to query. If omitted, the command may attempt to discover devices or apply to a default device.

-i, --info
    Displays comprehensive information about the specified or auto-detected HP device, including model, firmware, and supported features.

-l, --list
    Lists all auto-detected HP devices accessible to the system, showing their device URIs and models.

-s, --status
    Queries and reports the current status of the specified or auto-detected HP device, such as 'idle', 'printing', or 'error'.

-V, --version
    Shows the version of the HPLIP package installed on the system.

-?, --help
    Displays a concise help message with a summary of command-line options.

--debug
    Enables debug mode, providing more verbose output for troubleshooting.

DESCRIPTION

hp-query is a command-line utility that is part of the HPLIP (HP Linux Imaging and Printing) project. It serves as a diagnostic and information-gathering tool for HP printers and multi-function devices connected to a Linux system.

Users can leverage hp-query to retrieve various details about their HP hardware, including its current status, detected capabilities, configuration, and any encountered error conditions. It's particularly useful for troubleshooting connectivity problems or device malfunctions, offering a textual interface to inspect HP-specific information without relying on graphical tools. The command supports querying specific devices via their URI or discovering all available HP devices on the network or via USB.

CAVEATS

hp-query relies on the HPLIP (HP Linux Imaging and Printing) drivers and libraries being correctly installed and configured on the system. Some operations, particularly device discovery or detailed information retrieval, might require root privileges or proper user group permissions for device access.

The output can be highly verbose and may require filtering or parsing for specific pieces of information. Device URIs can sometimes be complex and specific to the connection type (USB, network).

ROLE IN TROUBLESHOOTING

Primarily used by system administrators and advanced users for diagnosing connectivity issues, checking device health, and verifying configuration details of HP printers and scanners. It helps in quickly identifying whether a problem lies with the device itself or the printing subsystem.

INTEGRATION WITH CUPS

While hp-query provides HP-specific device details, it often complements the standard CUPS printing system. It can retrieve device URIs that are then used by CUPS commands like lpadmin or lpstat for printer queue management.

HISTORY

hp-query is an integral part of the HPLIP (HP Linux Imaging and Printing) project, which was initiated by HP in the early 2000s. The primary goal of HPLIP was to provide robust and comprehensive open-source drivers and utilities for HP printers and multi-function devices on Linux operating systems, integrating seamlessly with the CUPS printing system. hp-query was developed as a key diagnostic and information-gathering tool within this suite, enabling users and system administrators to troubleshoot and manage HP hardware from the command line. Its development has paralleled the evolution of the HPLIP project itself, with ongoing updates to support new HP models and Linux distributions.

SEE ALSO

hp-setup(1), hp-info(1), lpstat(1), cupsd(8)

Copied to clipboard