lprm command is used to delete print jobs in the print queue. It is a command-line utility that enables the user to remove print jobs from the queue that are no longer needed or have been printed already.
The syntax for the
lprm command is as follows:
lprm [options] [job ID(s)]
options argument is optional and can be used to modify the behavior of the
lprm command. The
job ID(s) argument is also optional and can be used to specify the ID of the job that needs to be deleted. If no job ID is specified, the command will delete the first job in the queue.
To delete a print job, the user needs to know the ID of the job that needs to be deleted. The job ID can be obtained by running the
lpq command, which displays the print queue and the job IDs associated with each print job. Once the job ID is known, the user can run the
lprm command with the appropriate options and job ID to delete the print job.
To delete the first job in the print queue, run the following command:
To delete a specific job with ID 123, run the following command:
To delete all jobs in the queue, run the following command:
lprm command supports the following options:
|-P destination||Specifies the printer destination to use.|
|–||Deletes all jobs in the queue.|
|-U username||Specifies the username to use when deleting jobs.|
|-i||Prompts the user for confirmation before deleting each job.|
|-r||Deletes all jobs owned by the current user.|
|-s||Displays a summary of the jobs that have been deleted.|
|-V||Displays the version of the
lprm command fails to delete a print job, try the following troubleshooting tips:
- Ensure that the correct job ID has been specified.
- Check that the printer is online and available.
- Verify that the user has the necessary permissions to delete print jobs.
- Restart the print system using the
systemctl restart cupscommand.
lprmcommand is part of the Common Unix Printing System (CUPS) and is available on most Linux distributions.
lprmcommand can only delete print jobs that have not yet been printed. Once a print job has been printed, it is no longer in the queue and cannot be deleted using the