Home / Alt manpages / lpstat(1)

  • lpstat(1)
  • User command
  • linux

Check CUPS Printers and Queues with lpstat

You will finish with a short, repeatable check for the CUPS scheduler, default printer, queues and printer devices. The commands are read-only: they inspect status and do not enable, disable, cancel or submit print jobs.

Allow about ten minutes. You need a shell and the cups-client package. This guide uses lpstat from cups-client version 2.4.7-1.2ubuntu7.14, as installed on the reference machine. Printer names, queued jobs and server responses will differ on your host.

1. Confirm the installed command

Check which executable your shell will run and record the package version. These are ordinary, unprivileged commands:

$ command -v lpstat
/usr/bin/lpstat
$ dpkg-query -W -f='${Package} ${Version}\n' cups-client
cups-client 2.4.7-1.2ubuntu7.14

If dpkg-query is not available, use your distribution's package query tool. The useful check is that lpstat exists and belongs to the CUPS client tools you intended to use.

Checkpoint: the command must be lpstat from the expected installation. Do not troubleshoot a different copy found earlier in PATH.

2. Check the scheduler first

Ask whether the local CUPS scheduler is running:

$ lpstat -r
scheduler is running

The -r option reports the scheduler state and returns a successful exit status when the query works. If it says scheduler is not running, start or repair the CUPS service using your system's normal service-management procedure. That is an administrative change and may require elevated privileges, for example sudo; it is outside this status check.

Do not interpret every non-zero status as proof that a printer is broken. For example, a host with no scheduler can return an error for printer and queue queries, while a scheduler that is running can still have no configured destinations.

3. Identify the server and default destination

Use -H to show the server and port selected for the query:

$ lpstat -H
localhost:631

Then check the current default destination:

$ lpstat -d
system default destination: Office_Printer

Your output can instead say no system default destination. That is a valid finding, not a command failure. It means no default printer is configured for this user and system combination. Do not invent a destination name from a label on the physical printer.

The -H option shows where the client is talking. It does not change the server. The -d option reports the default and does not set one.

4. List printers, devices and accepting state

Inspect configured printers with the three focused reports below:

$ lpstat -p
printer Office_Printer is idle.  enabled since Tue 24 Sep 2026 09:10:00 BST
$ lpstat -v
device for Office_Printer: ipp://print.example.invalid/ipp/print
$ lpstat -a
Office_Printer accepting requests since Tue 24 Sep 2026 09:10:00 BST

The exact timestamps and device URI are host-specific. The -p report describes whether destinations are enabled for printing, -v shows the attached device, and -a shows whether queues accept new jobs. These states are related but not identical: an enabled printer can still have a queue that is not accepting requests.

To narrow a report to a known printer, place its name after the option:

$ lpstat -p Office_Printer
printer Office_Printer is idle.  enabled since Tue 24 Sep 2026 09:10:00 BST
$ lpstat -v Office_Printer
device for Office_Printer: ipp://print.example.invalid/ipp/print

If you do not know the exact name, omit the name and let lpstat list all configured printers. Printer and class names are not case-sensitive, but names cannot contain spaces, tabs, / or # under CUPS.

5. Inspect pending and completed jobs

With no arguments, lpstat lists active jobs queued by the current user. -o lists jobs on specified destinations, or all jobs when no destination is supplied:

$ lpstat -o
Office_Printer-42   andy             1024   Tue 24 Sep 2026 09:21:00 BST
$ lpstat -o Office_Printer
Office_Printer-42   andy             1024   Tue 24 Sep 2026 09:21:00 BST

A quiet result means that no matching jobs were reported; it is not an error. Add -u to inspect jobs for a specified user, or omit its user argument for the current user:

$ lpstat -u andy
Office_Printer-42   andy             1024   Tue 24 Sep 2026 09:21:00 BST

To include completed jobs, put -W completed before -o and before any printer names:

$ lpstat -W completed -o Office_Printer
Office_Printer-41   andy             2048   Tue 24 Sep 2026 09:05:00 BST

This ordering is a CUPS-specific trap. If -W appears after -o or after a printer name, the scheduler uses the default not-completed value instead. The alternate value is not-completed, which is also the default.

lpstat only reports jobs here. It does not cancel them. Do not follow a status check with cancel unless cancelling a job is an explicit, separately reviewed action.

6. Use the combined reports carefully

For a compact overview, use -s:

$ lpstat -s
system default destination: Office_Printer
device for Office_Printer: ipp://print.example.invalid/ipp/print

This combines the default destination, classes and devices. For all status information, including scheduler state, accepting state, printer state and jobs, use -t:

$ lpstat -t
scheduler is running
system default destination: Office_Printer
device for Office_Printer: ipp://print.example.invalid/ipp/print
printer Office_Printer accepting requests since Tue 24 Sep 2026 09:10:00 BST
printer Office_Printer is idle.  enabled since Tue 24 Sep 2026 09:10:00 BST

These examples are illustrative: output order, job lines and class lines depend on the server. If a script needs one fact, prefer the focused option rather than parsing the larger -t report.

7. Diagnose a remote or protected server

Use -h before every other option when querying another CUPS server:

$ lpstat -h print-server.example.invalid:631 -r
scheduler is running

The server argument can include a port. The option must occur first; keeping it first also makes scripts easier to audit. Use -E when the connection must be encrypted, and -U USERNAME when the server expects a different authenticated username:

$ lpstat -E -U printer-auditor -h print-server.example.invalid:631 -p
printer Office_Printer is idle.  enabled since Tue 24 Sep 2026 09:10:00 BST

Authentication, TLS trust and server permissions can make this fail even when the printer is healthy. Do not put passwords in the command line or paste credentials into shell history. If the server is unavailable, check the hostname, port, network path and CUPS server logs with the administrator responsible for that server.

Done means

  • lpstat is the expected binary from the installed cups-client package.
  • You checked the scheduler with lpstat -r and recorded the selected server with lpstat -H.
  • You distinguished a missing default destination from a stopped scheduler.
  • You used -p, -v and -a to separate printer, device and queue state.
  • You placed -W completed before -o when checking completed jobs.
  • No printer configuration, service state or queued job was changed.