lpq
Show printer queue status
TLDR
Show the queued jobs of the default destination
Show the queued jobs of all printers enforcing encryption
Show the queued jobs in a long format
Show the queued jobs of a specific printer or class
Show the queued jobs once every n seconds until the queue is empty
SYNOPSIS
lpq [-P printer] [-l] [-a] [-s] [+interval] [job_id ...] [user ...]
PARAMETERS
-P printer
Specifies the printer name whose queue should be queried.
-l
Displays job information in a long, more detailed format.
-a
Shows the queue status for all available printers.
-s
Provides a brief, summary-style output.
+interval
Continuously polls and updates the queue status every 'interval' seconds.
job_id ...
Displays status for specific print job IDs.
user ...
Displays status for jobs submitted by specific users.
DESCRIPTION
lpq is a command-line utility used to examine the contents of a printer's spool queue. It displays information about jobs currently waiting to be printed, including their unique job ID, owner, size, and status. This command is historically part of the traditional BSD line printer spooling system and is widely available on Linux systems, often integrated with or provided for compatibility with the Common Unix Printing System (CUPS). It empowers users to quickly check the progress of their print jobs, ascertain printer readiness, and diagnose potential printing bottlenecks.
CAVEATS
On modern Linux, lpq often interacts with the Common Unix Printing System (CUPS). Its exact behavior and available options can vary based on CUPS configuration or specific lpq implementation. Functionality might be limited if CUPS is not running or properly configured, or if the system uses an entirely different print spooler.
UNDERSTANDING OUTPUT
The output typically includes the job's queue position, owner, size, and the file name(s) being printed. A 'status' column indicates if a job is active, waiting, or held. If no output appears, the queue is likely empty or no jobs match the criteria.
INTEGRATION WITH CUPS
While conceptually rooted in BSD, modern lpq on Linux often functions as a client to the CUPS daemon. This means its capabilities and the interpretation of its output are dependent on the underlying CUPS configuration and server status.
HISTORY
lpq traces its origins to the Berkeley Software Distribution (BSD) printing system, a foundational component of early Unix-like operating systems. It was a key utility in the lpr/lpd suite, designed for managing print jobs on network printers. While the Common Unix Printing System (CUPS) largely replaced the BSD printing model on Linux, lpq is retained for backward compatibility, frequently acting as a wrapper that translates traditional commands into CUPS operations.