How to Use lpstat and lpadmin Commands in macOS Terminal to Manage CUPS Print Queues and Drivers

The macOS printing subsystem is built directly upon the Common UNIX Printing System (CUPS), an open-source printing architecture developed by Apple. While the macOS System Settings application provides a simplified printer management interface, managing stuck print jobs, querying raw spool status, configuring enterprise network printer options, and restarting print daemons is far faster using the command line. The lpstat and lpadmin commands in macOS Terminal provide complete administrative control over CUPS print queues.

Understanding the macOS CUPS Printing Architecture

In macOS, all print requests pass through the local CUPS scheduler daemon (cupsd) listening locally. When an application prints a document, CUPS renders the output into PostScript or PDF, filters the job using PostScript Printer Description (PPD) files, and dispatches the raw byte stream over network protocols (LPD, IPP, or AppSocket/JetDirect). Using Terminal commands allows administrators to automate printer deployments across enterprise Mac fleets via MDM shell scripts.

Syntax and Key Parameters

1. lpstat Functionality

Displays status information regarding current print queues, jobs, and printers.

lpstat [-p] [-d] [-r] [-o] [-s] [-a]
  • -p: Lists all configured printers and their current status (idle, printing, or disabled).
  • -d: Displays the system-wide default printer.
  • -r: Checks whether the local CUPS print scheduler is running.
  • -o: Lists all active and pending print jobs across all queues.
  • -s: Displays a complete summary of printers, default destinations, and device URIs.

2. lpadmin Functionality

Configures printer queues, sets options, and binds PPD drivers (requires administrative privileges).

lpadmin [-p printer_name] [-E] [-v device_uri] [-P ppd_path] [-x printer_name]
  • -p <name>: Specifies the printer queue destination name.
  • -E: Enables the printer queue and accepts new incoming jobs immediately.
  • -v <uri>: Sets the device connection URI (e.g. ipp://192.168.1.50/printers/queue).
  • -P <path>: Specifies the absolute file path to the printer’s PPD driver file.
  • -x <name>: Deletes the specified printer queue from the system.

Step-by-Step Practical Implementation

Step 1: Inspect All Active Printers and Scheduler Status

  1. Open Terminal from /Applications/Utilities/.
  2. Verify that the CUPS scheduler is active:
    lpstat -r
    Output: scheduler is running.
  3. Display all installed printers and their status:
    lpstat -p
    Output: printer Office_Laser is idle. enabled since Fri Oct 17 02:40:00 2026.

Step 2: Inspecting and Clearing Stuck Print Jobs

  1. If printing stalls, list all stuck jobs in the spool:
    lpstat -o
    Output: Office_Laser-142 user 102400 Oct 17 02:41.
  2. Cancel a specific job by its ID:
    cancel Office_Laser-142
  3. Or purge all pending print jobs across every queue on your Mac:
    cancel -a

Step 3: Setting the Default System Printer

To assign a specific printer queue as the default for all macOS applications:

lpoptions -d Office_Laser

Step 4: Adding a Network Printer via CLI with lpadmin

To programmatically provision an enterprise network printer using IPP protocol and a standard AirPrint generic driver:

sudo lpadmin -p "Finance_HP" -E -v "ipp://192.168.1.100/ipp/print" -m everywhere

The -m everywhere parameter leverages modern driverless IPP Everywhere / AirPrint auto-negotiation, eliminating manual PPD file downloads.

CUPS Command Utility Reference

Command Primary Role Root Required Target Resource
lpstat -p -d Shows printer status and default destination No Status query
lpstat -o Lists pending print spool jobs No Print spool
cancel -a Cancels all print jobs system-wide No (Own jobs) / Yes (All) Spool queue
lpadmin -p -E Creates or configures a printer queue Yes Printer provisioning
lpadmin -x <name> Removes an existing printer queue Yes Queue deletion
cupsenable <name> Resumes a paused printer queue Yes Queue state

Troubleshooting Common Errors

  • Queue Paused / Stopped: If a printer displays an error (such as out-of-paper), CUPS may stop the queue permanently. Clear the jam and re-enable the queue with cupsenable <printer_name>.
  • Accessing Web Administration: CUPS includes a local web GUI at http://localhost:631. If blocked with a “Web Interface is Disabled” error, enable it via Terminal: cupsctl WebInterface=yes.
  • Permission Denied on lpadmin: Configuring system-level print queues alters /etc/cups/printers.conf. Always prefix lpadmin commands with sudo.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.