Find Out HP Network Printer Serial Number with Bash Shell On Linux/Unix

I manage a small network including couple of HP printers. Is there an easy way to access HP printer serial number in the terminal on Linux or Unix-like system? How do I find the model, product, and serial number on my HP printer using bash command line options?

There are many ways to get this information i.e. you can find out HP network printer serial number using bash shell on a Linux or Unix like systems. This tutorial expalins how to find the serial number of your HP printer devices using the command line options on a Linux or Unix-like systems.

Tool To Find Out HP Network Printer Serial Number Remotely Using Bash SHELL

  1. curl command – Standard tool to transfer data from or to a server.
  2. [donotprint]
    Tutorial details
    Difficulty Easy (rss)
    Root privileges No
    Requirements Unix shell
    Time 1m
    [/donotprint]
  3. hp-info command – Part of hp-toolbox software.
  4. Printer Management Language to get information from the printer.

Use curl command to query HP printer for serial number

Most HP printers comes with an embedded web-server called HP HTTP Server. The web-server exposes the following info:

  • Printer name and model
  • Printer Firmware number
  • Printer serial number

Examples to find the serial number for HP printer

The curl command is available on Linux, Apple OS X, FreeBSD, OpenBSD, and Unix-like operating system. Let us say your printer IP address is 192.168.1.100, enter:
curl -k -I https://192.168.1.100
OR
curl -I http://192.168.1.100
Sample outputs:

Fig.01: Query printer for serial number

In this sample outputs my printer details are as follows:
  • Printer name: HP Officejet Pro 8600
  • Printer model number: CM750A
  • Printer serial number: CN276BKXYZZZZYY
  • Printer firmware number: CLP1CN1516AR

hp-info command to get HP network printer serial number

The hp-info command query a printer for static model information, dynamic status informtion, and CUPS printer queue settings. This is part of HPLIP (Hewlett-Packard Linux Imaging and Printing). Itt is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux.
$ hp-info
Sample outputs:

Fig.02: hp-info command in action

$ hp-query -n -d 'hp_device_name_here'
Sample outputs:

Fig.03: hp-query command in action

Conclusion

And there you have it. You just use the curl command to grab information about your HP network printer. It is helpful to upgrade drivers or firmware or get support when you call HP support. You can grab HP open source driver here.

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
4 comments… add one
  • JML-72 Oct 13, 2015 @ 12:28

    Bonjour,

    Une autre alternative serait d’interroger l’agent SNMP de l’imprimante en utilisant l’OID qui pointe sur le bon attribut. Ainsi sur une imprimante Ricoh j’utilise:

    ~ $ snmpwalk -v1 -c public 10.XXX.XXX.XXX SNMPv2-SMI::mib-2.43.5.1.1.17.1 [Enter]
    SNMPv2-SMI::mib-2.43.5.1.1.17.1 = STRING: “V9414500848”

    Pour trouver l’OID en connaissant d’avance le numéro de série:

    ~ $ snmpwalk -v1 -c public 10.XXX.XXX.XXX | grep V9414500848 [Enter]
    SNMPv2-SMI::mib-2.43.5.1.1.17.1 = STRING: “V9414500848”

    (10.XXX.XXX.XXX adresse IP de l’imprimante)

  • Jalal Hajigholamali Oct 14, 2015 @ 5:23

    Hi,
    Very useful article…
    Thanks a lot..

  • Philippe Petrinko Oct 14, 2015 @ 6:07

    I use HP printers, and I didn’t know the hp-query tool, interesting, thanks.
    I didn’t either thought of using [curl], useful too.

    And [snmpwalk] is not to forget. Thanks JML-92. (merci ;-) ) but I don’t know if any network-able HP printer does answer to snmp queries.

    __Philippe

  • Kiruby Oct 15, 2015 @ 6:31

    Good stuff.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.