Linux Printing with the lp Command: Print Jobs, Queues and Practical Administration

Follow a Linux print job from lp through CUPS and the network to the printer, then use that model to choose options and isolate failures.

Linux FundamentalslpCUPSPrint Administration
8-part learning path

Linux Fundamentals for IT & Network Engineers

Each part adds a practical administration skill used in NOC, network, cloud and server roles.

Part 5 of 8
Lesson overview

In This Lesson

Build the printing model first, practise focused lp options, then apply the same layers to workstation, server, warehouse and troubleshooting scenarios.

  1. How Linux printing works
  2. lp syntax and destinations
  3. Copies, ranges and job options
  4. Text and document formats
  5. Workstations, servers and industry use
  6. Layered troubleshooting
From file to physical output

Quick Learning Map

Keep these three stages in view as you work through the detailed lesson.

1

Submit intentionally

Choose the destination, file and supported job options with lp.

2

Follow the queue

CUPS accepts, filters, schedules and forwards the print job.

3

Trace every layer

Separate host, network, print-server and printer failures.

Linux Printing Workflow at a Glance

A successful job must cross every layer. A message that the job was accepted proves only that the queue received it; it does not prove that paper reached the output tray.

Linux printing workflow showing application or file, lp, CUPS print queue, network and printer, with possible failure points at every layer
Application/File → lp → CUPS / Print Queue → Network → Printer. Check the path from left to right.

How Linux Printing Works

Most modern Linux systems use CUPS, the Common UNIX Printing System. CUPS exposes printers as named destinations, accepts jobs through the Internet Printing Protocol (IPP), holds them in queues, converts supported content when necessary, and sends it to the chosen device.

Print client

The application or command that asks the printing system to create a job. Here, lp is the client.

Print queue

A logical destination that stores job metadata and orders pending work. A queue can be paused while the printer remains powered on.

Printer

The physical device that consumes the job. It may be attached locally by USB or reached through a network or print server.

Print job

One submitted unit of work: content plus attributes such as destination, copies, media and title. CUPS normally returns a job ID.

Default printer

The destination selected when -d is omitted. It can come from user, system, environment or application configuration.

Local versus network

A network printer or shared queue adds DNS, routing, firewall and server dependencies to the local printing path.

CUPS concept: the scheduler receives the job, applies supported filters, queues it and forwards the result through the configured backend. Driverless IPP printers often advertise their capabilities directly.

The lp Command: Syntax and Everyday Use

lp submits files—or standard input when no file is named—to a CUPS destination. Options describe how the job should be handled.

lp [options] [--] [file ...]

Print a file

lp monthly-report.pdf
# request id is office-printer-184 (1 file(s))

If a default destination exists, CUPS sends the file there. The returned request ID identifies the queue and job.

Select a printer

lp -d finance-printer monthly-report.pdf
lp -d warehouse-labels "dispatch labels.pdf"

The value after -d is the CUPS destination name, which may differ from the label printed on the device.

Print standard input

printf 'Shift handover: Dock 4 complete\n' | \
  lp -d operations-printer -t "Shift handover"

The -t title makes an automated job recognizable in the queue.

Copies, Page Ranges and Job Options

RequirementExampleMeaning
Choose destinationlp -d reception file.pdfSubmit to the named queue.
Print copieslp -n 3 file.pdfRequest three copies as one job.
Select pageslp -P 2-5,8 file.pdfRequest pages 2–5 and 8 where supported.
Set a titlelp -t "Daily stock" stock.pdfGive operators a useful queue label.
Set medialp -o media=A4 file.pdfRequest A4 through a CUPS/IPP option.
Print duplexlp -o sides=two-sided-long-edge file.pdfRequest long-edge two-sided output.
Fit contentlp -o fit-to-page diagram.pdfScale content to the printable area.

Options can be combined:

lp -d office-color -n 2 -P 1-4 \
  -o media=A4 -o sides=two-sided-long-edge \
  -t "Quarterly review" quarterly-review.pdf
Support matters: lp can submit an option, but the queue, filter and printer decide whether it can be honored. Page ranges work best with page-oriented documents such as PDF.

More focused patterns

# Landscape orientation (IPP value 4)
lp -d office-color -o orientation-requested=4 floor-plan.pdf

# Monochrome, if the destination advertises it
lp -d office-color -o print-color-mode=monochrome invoice.pdf

# Stop a file beginning with "-" being parsed as an option
lp -- -draft.pdf

Printing Text and Supported Documents

Plain text and formatted documents are not identical jobs. Text needs font, margin, wrapping and pagination decisions; a PDF already describes its pages and layout.

Plain text

lp notes.txt commonly works when a text-to-page filter is available. Long lines, tabs and Unicode glyphs may render differently.

PDF and images

PDF, JPEG and PNG are common, but acceptance depends on CUPS filters or formats advertised by a driverless IPP printer.

Application documents

Office documents are normally rendered or exported first. An arbitrary word-processor file may fail because CUPS has no converter for it.

For predictable automation, generate a stable format such as PDF and test the exact media, duplex and page-range options used in production.

Workstations, Print Servers and Industry Use

Office Linux workstation

A desktop application or lp submits to local CUPS, a shared queue or a driverless IPP printer. Site policy may provide the default destination.

Central print server

A shared server centralizes queues, capabilities, access policy, accounting and retries. One server-side pause can affect many users.

Warehouse and labels

Exact media size, orientation and one-job-per-package behavior matter. Clear job titles help operators identify delayed or duplicate labels.

Label printer example

lp -d warehouse-labels -n 1 \
  -o media=Custom.100x150mm \
  -t "Order 78431" order-78431.pdf

The media keyword is an example; use the value supported by the deployed queue. A raw printer language is not automatically portable between models.

Automated report example

lp -d operations-printer \
  -o sides=two-sided-long-edge \
  -t "Daily operations report 2026-09-26" \
  /srv/reports/operations-2026-09-26.pdf

Automation should record the lp exit status and returned request ID. Submission success is only the first checkpoint.

Troubleshooting the Complete Printing Path

A Linux print failure may originate several hops away. Work in this order: Linux Host → Network → Print Server → Printer.

  1. Linux hostConfirm that the file is readable, the destination is correct, a default exists when -d is omitted, and the local printing service is available.
  2. NetworkSeparate DNS resolution from IP reachability. Check VLAN policy, routing, Wi-Fi isolation, VPN paths and firewalls conceptually.
  3. Print serverConfirm that the service is running, the queue exists, accepts jobs and is enabled, and its backend can reach the printer.
  4. PrinterCheck power, link, IP address, paper or labels, toner, covers, jams and requested media.

Common error patterns

SymptomLikely layerInterpretation
No default destinationLinux hostChoose a valid queue explicitly with -d.
Unknown destinationHost / configurationThe queue name is not configured or discoverable.
Permission denied or ForbiddenHost / server policyThe user cannot read the file or submit to that destination.
Unable to connectService / networkThe scheduler, server or printer endpoint is unavailable, blocked or misaddressed.
Job remains pendingQueue / downstreamThe queue may be paused, held or waiting for a downstream device.
Wrong layoutFormat / capabilityMedia, orientation, scaling or filter behavior differs from the request.
Permission boundary: ordinary users normally can submit to allowed queues without root access. Changing printers, server policy or queue state is an administrative action.

A Realistic lp Practice Sequence

Print two duplex copies of pages 2 through 5 from an A4 report on the shared finance queue:

lp -d finance-printer \
  -n 2 -P 2-5 \
  -o media=A4 -o sides=two-sided-long-edge \
  -t "Budget review" budget-review.pdf
  • Submit: the shell passes the file and attributes to lp.
  • Queue: CUPS records, processes and schedules one job.
  • Deliver: the path reaches the local printer or crosses the network and print server.
  • Verify: record the request ID and avoid submitting duplicates while investigating.

Linux Printing Frequently Asked Questions

What does the lp command do in Linux?

It submits a file or standard input as a print job to a CUPS destination and can attach options such as copies, media, page ranges and a title.

How do I choose a printer with lp?

Use lp -d destination-name file.pdf. The queue name may differ from the label on the physical printer.

Why does lp accept a job but nothing prints?

Acceptance only proves that the queue received it. The queue may be paused, the network or print server may be unavailable, or the printer may be offline, jammed or waiting for media.

Can lp print PDF and image files?

Usually, when CUPS has a suitable filter or the IPP printer advertises direct support. Capabilities vary by queue and printer.

Does lp require root permission?

Ordinary users normally can submit to allowed queues. Administrative changes and restricted destinations may require added privileges or authentication.