cancel command is used to cancel an existing print job. This command is helpful when a user has accidentally sent a print job to a printer, or when a print job is stuck in the queue and cannot be removed using traditional methods.
The syntax for the
cancel command is as follows:
cancel [options] [job ID(s)]
options argument is optional and can be used to specify various settings for the command. The
job ID(s) argument is also optional and can be used to specify the ID number of the print job(s) to be canceled.
To cancel a specific print job, use the following command:
To cancel multiple print jobs, use the following command:
cancel 123 456 789
To cancel all print jobs, use the following command:
Specific Use Cases
- Cancelling a print job that has been sent to the wrong printer
- Removing a print job that is stuck in the queue and cannot be removed using traditional methods
- Cancelling a print job that contains sensitive or confidential information
The following table lists all available options for the
|-a, –all||Cancel all print jobs|
|-h, –help||Display help information|
|-u, –user||Cancel all print jobs for a specific user|
- If the
cancelcommand does not work, try using the
killcommand to terminate the print job instead.
- If the print job is still not being cancelled, try stopping and restarting the
cancelcommand is only available on systems that use the Common Unix Printing System (CUPS).
cancelcommand requires root privileges to run.