lpstat – Displays status information about printers in CUPS

The lpstat command is used to display the status information about printers in the Common UNIX Printing System (CUPS). It is a command-line utility that provides detailed information about the printers configured in the system. The lpstat command can be used to display the status of print jobs, printers, and classes.

Overview

The lpstat command is used to display the status information about printers in CUPS. The syntax for the command is as follows:

lpstat [options]

When the lpstat command is executed without any options, it displays a summary of the current print queue status. This includes the number of jobs queued, the status of each job, and the name of the printer that the job is queued for.

Examples

  1. Display the status of all printers:
lpstat
  1. Display the status of a specific printer:
lpstat -p printer_name
  1. Display the status of all jobs:
lpstat -o
  1. Display the status of a specific job:
lpstat -o job_id
  1. Display the status of all printers and their associated jobs:
lpstat -t
  1. Display the status of all classes:
lpstat -c
  1. Display the status of a specific class:
lpstat -c class_name

Options

The following table lists the available options for the lpstat command:

Option Description
-a Display the status of all printers, including those that are disabled
-c Display the status of all printer classes
-d Display the default printer
-h Specify the CUPS server
-o Display the status of all jobs
-p Display the status of a specific printer
-r Display the status of the CUPS server
-s Display the status of the scheduler
-t Display the status of all printers and their associated jobs
-u Display the status of jobs for a specific user
-v Display the status of all printers and their associated devices

Troubleshooting Tips

If the lpstat command returns an error, ensure that CUPS is running and that the printer is properly configured. If the printer is not responding, try restarting the printer or checking the printer’s connections. If the issue persists, check the CUPS logs for any error messages.

Notes

  • The lpstat command can be used to troubleshoot printing issues and to monitor the status of print jobs and printers.
  • The lpstat command is included in most Linux distributions and is part of the CUPS printing system.