Exercise: Print Queue Management (CLI)
Viewing and Controlling Print Jobs
1 Purpose
While sending a print job is easy, a key skill for any technician is managing the print queue. This exercise introduces you to the fundamental commands for this task. You will learn how to simulate a common problem (an offline printer) by pausing the queue, see how jobs get “held” by the spooler, and then use command-line tools to view and cancel those jobs.
2 What You’ll Accomplish
By the end of this exercise, you will be able to:
- Pause and resume a print queue using the CUPS web interface.
- View the status of print jobs using the
lpstatcommand. - Cancel a pending print job using the
cancelcommand.
This exercise maps to the following program and course learning outcomes:
- Course Learning Outcomes (CLOs):
- 3. Troubleshoot hardware and basic network components: Managing the print queue is a common step in diagnosing why a document isn’t printing.
This exercise develops the following skills, which align with the O*NET SOC Code 15-1232.00 for Computer User Support Specialists.
| Learning Objective | O*NET KSAs | Technologies Used |
|---|---|---|
| View and cancel print jobs from the CLI. | Knowledge: Computers & Electronics Skills: Troubleshooting, Systems Analysis |
lpstat, cancel |
3 Prerequisites
This exercise requires a running Fedora 43 virtual machine where you have completed Exercise 10.2 and the ippeveprinter.service is active and running.
4 Step-by-Step Guide
4.1 Step 1: Pause the Print Queue
To see a job in the queue, we need to prevent it from printing immediately. We can do this by pausing the printer.
- Open the Firefox browser and navigate to the CUPS web interface:
http://localhost:631 - Click the Printers tab at the top of the page.
- Click on the name of your printer,
IPP-Persistent-Printer. - From the Maintenance dropdown menu, select Pause Printer.
- The printer’s status should now change to “Paused”.
4.2 Step 2: Submit a Print Job
Now, with the printer paused, we will send a job to it.
Open a terminal.
Use the
echoandlpcommands to submit a job:echo "This job will be held and then canceled." | lp -d IPP-Persistent-PrinterNote the job ID that is returned (e.g.,
IPP-Persistent-Printer-1).
4.3 Step 3: Observe the Held Job
Let’s check the status of the print queue using lpstat.
In the terminal, run the following command:
lpstat -oYou will see your job listed with its ID. Because the printer is paused, the job is being held by the CUPS spooler.
4.4 Step 4: Cancel the Job
Now, use the cancel command with the job ID you noted to remove the job from the queue.
Run the command, replacing
IPP-Persistent-Printer-1with your actual job ID:cancel IPP-Persistent-Printer-1Verify that the queue is now empty:
lpstat -oThe command should produce no output, confirming the job has been removed.
4.5 Step 5: Resume the Printer
It’s good practice to return the printer to its normal state.
- Go back to the CUPS web interface.
- From the Maintenance dropdown menu for the
IPP-Persistent-Printer, select Resume Printer.
5 Reflect and Review
Now that you have completed this exercise, reflect on your experience in your personal notes:
- 3 commands you used in this exercise.
- 2 different statuses you observed for a print queue (e.g., Paused, Idle).
- 1 question you still have about print job IDs.
Answer these questions in your notes to solidify your understanding:
- What command is used to view the current print jobs?
- What piece of information do you need to cancel a specific print job?
- In the CUPS web interface, what action did you take to ensure a print job would stay in the queue long enough to be canceled?
- What does the
lpstat -ocommand show?