lpstat - macOS
Overview
lpstat
is a macOS command-line utility that provides information about print jobs, printers, and the print queue. It offers a comprehensive interface for managing print-related tasks and monitoring the status of printing operations.
Syntax
lpstat [options] [job-id | printer-name]
Options/Flags
- -a: Display all print jobs.
- -d: Display printer descriptions.
- -f: Filter jobs by user.
- -j: Display a specific print job by ID.
- -o: Display printer options.
- -p: Display printers.
- -P: Display printers by status.
- -u: Display print jobs by user.
Examples
- Display all print jobs:
lpstat -a
- Display information about a printer:
lpstat -p printer-name
- Filter print jobs by user:
lpstat -f username
- Cancel a print job:
cancel [job-id]
Common Issues
- Print job not found: Ensure the job ID is correct or use
-a
to display all jobs. - Permission denied: Check if the user has appropriate permissions to view or cancel the job.
Integration
lpstat
can be integrated with:
lp
: Submit print jobs.lpadmin
: Manage printers and queues.- Bash scripts: Automate print-related tasks.
Related Commands
lpr
– Submit print jobslprm
– Cancel print jobs