Print queue inspection (BSD family): Which command displays the current jobs in the print queue when using the BSD-style printing commands?

Difficulty: Easy

Correct Answer: lpq

Explanation:


Introduction / Context:
BSD-style printing utilities remain widely used, often via CUPS compatibility. Knowing which command lists queued print jobs helps diagnose stuck printouts, confirm submission, and manage priorities in multi-user environments.



Given Data / Assumptions:

  • The printing toolchain is the BSD set (lpr, lpq, lprm, lpc).
  • A print queue and at least one printer are configured.
  • The user needs to view queued jobs.


Concept / Approach:

In the BSD family, lpr submits print jobs, lpq displays the queue, lprm removes jobs, and lpc administers printing system parameters. On modern systems with CUPS, these commands map to the CUPS backend but retain their traditional roles.



Step-by-Step Solution:

Submit a job: lpr file.txtView queue: lpq or lpq -P printer_nameRemove a job: lprm job_idAdminister queues: lpc status, lpc stop/start printerMonitor: watch -n 2 lpq to refresh periodically


Verification / Alternative check:

Compare lpq output with the printer’s front panel or web UI. Also use lpstat (System V/CUPS) as an alternative if available.



Why Other Options Are Wrong:

b: lpr submits a job; it does not list queued jobs.

c: lprm removes jobs from the queue.

d: lpc handles administrative control and status, not simple queue listings in user workflows.

e: Not applicable because lpq is the correct queue viewer in the BSD set.



Common Pitfalls:

Looking at the wrong printer’s queue in multi-printer setups; forgetting default printer selection; and interpreting CUPS mappings incorrectly when troubleshooting legacy scripts.



Final Answer:

lpq

More Questions from Linux

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion