lprm - macOS


Overview

lprm is a macOS command used for removing print jobs from the print queue on a system. It allows you to manage print tasks and efficiently control the printing process.

Syntax

lprm [options] job_number(s)

Options/Flags

  • -P printer: Specifies the printer name for which print jobs should be removed.
  • -U username: Removes print jobs submitted by the specified user.
  • -a: Removes all print jobs for the current user.
  • -q: Runs the command in quiet mode, suppressing output.
  • -v: Runs the command in verbose mode, providing detailed output.

Examples

Remove a specific print job:

lprm 1234

Remove all print jobs for the current user:

lprm -a

Remove print jobs submitted by a specific user:

lprm -U john

Common Issues

  • Print job not found: Ensure you have the correct job number or use the -U or -a options to remove multiple jobs.
  • Permission denied: You may need to have administrator privileges to remove print jobs submitted by other users.

Integration

Combine with lpstat: Use lpstat -o to display detailed information about print jobs, and then use those job numbers with lprm.

  • lp: Lists print jobs and their status.
  • lpstat: Displays information about print jobs in the queue.
  • lpr: Submits print jobs to the queue.