It is easy to list the printers you've already installed with this command:
lpstat -a
However, this does not list network printers you have NOT installed.
nmap will scan for all open ports on the LAN, but the list produced won't be limited to network printers:
sudo nmap -sT 192.168.0.1-254
Is there a command that does the following:
- Detects the LAN you're currently connected to automatically.
- Scans the entire LAN looking for Network Printers specifically.
- Produces a list of Network Printers providing both their hostnames and IP addresses.
For example, I logged into the web interface of a Imagistics fx2100 printer today. It had a "Find device" feature that was capable of finding all the network printers on the LAN (see screenshot below). Notice that this Imagistics printer's built-in utility found printers of all brands (NOT just Imagistic ones).
It seems like there would be a command in Linux that could achieve the same list and info (without scripting):
nc
to verify that it can connect ontcp/9100
. You'd have to script something since this is a very specific problem you're trying to solve. So I doubt anyone's written a tool to do this.