44

I need a command to list available printers in my Ubuntu.

The printers list could be installed or shared?

This list also should state the state of the printer .

Any Help to achieve my goal?

4 Answers 4

46

The Command lpstat -p will list all available printers for your Desktop .

And whether or not they are available ( the state of them) .

2
  • 2
    Also works on macOS (Ventura 13.0)
    – Mint
    Nov 3, 2022 at 0:18
  • As of 2023, brian_p's answer is more correct. Nov 30, 2023 at 17:30
16

If you just want the printer names:

lpstat -p | awk '{print $2}'

To see their names and print queues:

lpstat -p | awk '{print $2}' | xargs -n1 lpq -P
3

I need a command to list available printers in my Ubuntu.

I have bolded available because the OP presumably means that.

Neither lpstat -p nor lpstat -t list all printers available on the local network. Both commands only show local (often called permanent) printers. Both appear to have gained some traction as inadequate responses to the query.

As of 2022, lpstat -e or lpstat -l -e give all available on the local network.

2

For the most detailed information about all available printers including local and lan printers, you can use -t option with lpstat

It tells you the following:

  1. Scheduler information
  2. Default printer
  3. Addresses of the printers
  4. Enabled status with timestamp
  5. Accepting jobs status with timestamp
  6. If a printer is currently printing

Here is the sample output

> lpstat -t

scheduler is running
system default destination: HP_Ink_Tank_Wireless_410_series_1C5045
device for Deskjet-Ink-Adv-2010-K010: hp:/usb/Deskjet_Ink_Adv_2010_K010?serial=CN12C11MQH05MB
device for HP_Ink_Tank_Wireless_410_series_1C5045: implicitclass://HP_Ink_Tank_Wireless_410_series_1C5045/
Deskjet-Ink-Adv-2010-K010 accepting requests since Saturday 30 April 2022 10:45:04 AM
HP_Ink_Tank_Wireless_410_series_1C5045 accepting requests since Monday 02 May 2022 01:54:54 PM
printer Deskjet-Ink-Adv-2010-K010 is idle.  enabled since Saturday 30 April 2022 10:45:04 AM
printer HP_Ink_Tank_Wireless_410_series_1C5045 now printing HP_Ink_Tank_Wireless_410_series_1C5045-202.  enabled since Monday 02 May 2022 01:54:54 PM
HP_Ink_Tank_Wireless_410_series_1C5045-202 user           679936   Monday 02 May 2022 01:54:54 PM

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .