Printing on UNIX systems: Which command submits a file to the System V–style print spooler for printing?

Difficulty: Easy

Correct Answer: lp

Explanation:


Introduction / Context:
UNIX systems traditionally use print spoolers to queue and manage print jobs. Two major families exist: System V (lp, lpstat, cancel) and BSD (lpr, lpq, lprm, lpc). Recognizing the correct submit command for your platform is vital in mixed environments and exams.



Given Data / Assumptions:

  • The question targets the System V command set.
  • A functioning print spooler and default destination are assumed.
  • Basic printing to a local or network printer is intended.


Concept / Approach:

System V printing uses lp to send a file to the queue. Options select destination printers, copies, and banner pages. The BSD toolset uses lpr for submission. Many modern systems provide compatibility layers so both sets work, but the native System V submit command remains lp.



Step-by-Step Solution:

Submit a file: lp document.txtChoose a printer: lp -d printer_name document.txtSet copies: lp -n 2 document.txtCheck queue status: lpstat -oCancel a job: cancel job_id


Verification / Alternative check:

Confirm printing with lpstat and by checking the printer output. On systems with both toolsets, verify which backend (CUPS) interprets lp commands and how it maps to printers.



Why Other Options Are Wrong:

b: pg is a pager for viewing files page-by-page on screen, not printing.

c, d: prn and print are DOS/Windows commands, not standard UNIX.

e: Not applicable because lp is correct in System V environments.



Common Pitfalls:

Submitting to the wrong default destination, forgetting to specify copies or duplex options, and overlooking that CUPS may unify lp and lpr behavior with different defaults. Always check lpoptions -p printer -l for supported features.



Final Answer:

lp

More Questions from Linux

Discussion & Comments

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