Exercise: Print Queue Management (CLI)

Viewing and Controlling Print Jobs

A hands-on exercise to manage print jobs from the command line, including viewing the queue with lpstat and canceling a job with cancel.
Author

Chuck Nelson

Published

November 16, 2025

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 lpstat command.
  • Cancel a pending print job using the cancel command.

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.

  1. Open the Firefox browser and navigate to the CUPS web interface: http://localhost:631
  2. Click the Printers tab at the top of the page.
  3. Click on the name of your printer, IPP-Persistent-Printer.
  4. From the Maintenance dropdown menu, select Pause Printer.
  5. 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.

  1. Open a terminal.

  2. Use the echo and lp commands to submit a job:

    echo "This job will be held and then canceled." | lp -d IPP-Persistent-Printer
  3. Note 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.

  1. In the terminal, run the following command:

    lpstat -o
  2. You 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.

  1. Run the command, replacing IPP-Persistent-Printer-1 with your actual job ID:

    cancel IPP-Persistent-Printer-1
  2. Verify that the queue is now empty:

    lpstat -o

    The 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.

  1. Go back to the CUPS web interface.
  2. From the Maintenance dropdown menu for the IPP-Persistent-Printer, select Resume Printer.

5 Reflect and Review

ImportantReflection: 3-2-1

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.
TipCheck on Learning

Answer these questions in your notes to solidify your understanding:

  1. What command is used to view the current print jobs?
  2. What piece of information do you need to cancel a specific print job?
  3. 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?
  4. What does the lpstat -o command show?
Back to top