lpstat
Show printer status information
TLDR
List printers present on the machine and whether they are enabled for printing
Show the default printer
Display all available status information
List print jobs queued by a specific user
SYNOPSIS
lpstat [options]
PARAMETERS
-a [printer]
Show acceptance status of destination(s). If printer is specified, output only that printers status.
-c [class]
Show class names and their members.
-d
Show default destination.
-e
Show all destination names.
-l
Show verbose/detailed status listings.
-o [destinations]
Show list of jobs on destination(s). If destionations are specified output jobs only for them. Can list job ids.
-p [printer]
Show printer status. If printer is specified only output the specified printers status.
-r
Show CUPS scheduler status (running or not).
-s
Show a summary of status information, including the scheduler status, the default destination, and the list of devices and destinations.
-t
Show all status information.
-u [user]
Show jobs queued for user(s). If user is not specified, show jobs for all users.
-W [which]
Show completed jobs. Default is show only pending jobs. Specify completed to show completed jobs, not-completed to show pending jobs, or all to show all.
DESCRIPTION
The lpstat
command is a powerful utility used to display status information about the CUPS printing system. It allows users to check the status of printers, jobs, classes, and the CUPS server itself. lpstat
can provide details such as whether a printer is enabled, accepting jobs, and any error messages that might be present. It's an invaluable tool for troubleshooting printing problems and managing the print queue. The command offers various options to filter the output, allowing users to focus on specific aspects of the printing system. It is often utilized in scripts and automation processes to monitor printer health and automatically report issues. With different options, the command can list all printers, specific printers, jobs owned by a user, and even server status. The status can be queried for specific printers and it works great in scripts for automated monitoring.
It's an indispensable tool for system administrators and end-users alike for managing and troubleshooting printing in a CUPS environment.
CAVEATS
The output and behavior of lpstat
can vary slightly depending on the CUPS version and the specific Linux distribution.
EXIT STATUS
The lpstat
command returns 0 on successful completion. A non-zero value indicates an error.
CONFIGURATION FILES
The command relies on the CUPS configuration files, typically located in /etc/cups
, for its information.
HISTORY
The lpstat
command has been a standard part of Unix-like operating systems for a long time. It originates from the System V printing system and has been adapted and modernized within the CUPS (Common Unix Printing System) environment. Its primary function has remained consistent: providing status information about the printing system.