3. Resources lpq Display Print queue lprm Job removal 1.107.2 2 1.107.2 Manage printers and print queues Weight 1 Linux Professional Institute Certification — 102 lpr Job submission /etc/printcap — Configuration file 3 Resources Resources of interest Printing-HOWTO Printing-Usage-HOWTO Andrew Eager andrew.eager@aes-pl.com.au Geoff Robertson Nick Urbanik This document Licensed under GPL—see section 7 4 Printer control with lpc • lpc Is used to control a printer or print job • Can be run interactively. lpc — Printer Control 2005 July 1 Context • Usage is: lpc [ command [ argument ]] Topic 107 Printing [3] 1.107.2 Manage printers and print queues [1] 1.107.3 Print files [1] 1.107.4 Install and configure local and remote printers [1] 4.1 lpc examples lpc — Printer Control Example 1 — Non Interactive: $ lpc status ← Printer lp@Node4 Example 2 — Interactive $ lpc ← lpc> status Printer lp@Node4 lpc> quit Printing Spooling Jobs enabled enabled 0 Server Subserver none none 2 Objective Description of Objective Candidates should be able to manage print queues and user print jobs. This objective includes monitoring print server and user print queues and troubleshooting general printing problems. Key files, terms, and utilities include: lpc Printing control Printing Spooling Jobs enabled enabled 0 Server Subserver none none 4.2 lpc commands 1.107.2 3 5.1 lpq example 1.107.2 4 4.2 lpc commands LPC Commands For a complete list of commands, use the command lpc help. Some of the more important commands to know are: abort — Immediately terminate active spool & disable printing disable — Stop spooling for this printer enable — Start spooling for this printer down — Disable spooling & printing up — Enable spooling & printing stop — Stop printing after current job is complete start — Enable spooling & start printing quit — Exit from interactive mode help — Show all commands With the CUPS printing system, lpc status is the only command implemented. Use lpadmin instead for controlling the queue. 5.1 lpq example lpq — Example Example — Show all jobs on default Queue # lpq Printer: lp@Node4 ’lp0’ (dest HPLjet@node10.aes) Queue: 2 printable jobs Server: pid 27354 active Unspooler: pid 27356 active Status: waiting for subserver to exit at 12:22:58.553 Rank Owner/ID Class Job Files .... 1 root@Node4+353 A 353 /etc/hosts .... 2 root@Node4+357 A 357 /etc/ntp.conf .... Printer: HPLjet@Node10 ’lp0’ (printing disabled ... 6 Removing printer jobs: lprm • lprm is used to remove jobs from a queue • jobs can be removed by: – by job-id (use lpq to find out) lprm — Remove job(s) from Queue 5 Show printer queue: lpq Usage is: • Every print job is assigned a job-id • You need the job-id to remove or reorder a job in the queue • lpq shows the job-id along with information about the job. – by user lpq — Display Printer Queue # lprm [-P printer] [Job-id ...] [user ...] 6.1 lprm example lprm — Example Example — Remove all jobs owned by root # lprm root Printer lp@Node4: checking perms ’root@Node4+353’ dequeued ’root@Node4+353’ checking perms ’root@Node4+357’ dequeued ’root@Node4+357’ Printer HPLjet@Node10: # lpq Usage is: $ lpq [-P printer] [Job-id] 7. License Of This Document 1.107.2 5 7 License Of This Document License Of This Document Copyright c 2005, 2002 Andrew Eager , Geoffrey Robertson , Nick Urbanik You can redistribute modified or unmodified copies of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation—either version 2 of the License or (at your option) any later version.