The 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.
Detailed Overview
The syntax for the cancel
command is as follows:
cancel [options] [job ID(s)]
The 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.
Examples
To cancel a specific print job, use the following command:
cancel 123
To cancel multiple print jobs, use the following command:
cancel 123 456 789
To cancel all print jobs, use the following command:
cancel -a
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
Options
The following table lists all available options for the cancel
command:
Option | Description |
---|---|
-a, –all | Cancel all print jobs |
-h, –help | Display help information |
-u, –user | Cancel all print jobs for a specific user |
Troubleshooting Tips
- If the
cancel
command does not work, try using thekill
command to terminate the print job instead. - If the print job is still not being cancelled, try stopping and restarting the
cups
service.
Notes
- The
cancel
command is only available on systems that use the Common Unix Printing System (CUPS). - The
cancel
command requires root privileges to run.