1.107.2 Manage printers and print queues Weight 1 Andrew Eager 1.107.2 Manage printers and print queues Weight 1 Linux Professional Institute Certification — 102 Context Objective Resources Printer control with lpc Show printer queue: lpq Removing printer jobs: lprm Andrew Eager andrew.eager@aes-pl.com.au Geoff Robertson Nick Urbanik This document Licensed under GPL—see section 7 License Of This Document 2005 July Outline 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc Context Objective Resources Printer control with lpc lpc examples lpc commands Show printer queue: lpq lpq example Removing printer jobs: lprm lprm example License Of This Document Show printer queue: lpq Removing printer jobs: lprm License Of This Document Topic 107 Printing [3] Where we are up to 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc Show printer queue: lpq 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] Removing printer jobs: lprm License Of This Document Description of Objective 1.107.2 Manage printers and print queues 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc 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. Show printer queue: lpq Removing printer jobs: lprm License Of This Document Key files, terms, and utilities include: 1.107.2 Manage printers and print queues 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc lpc Printing control lpq Display Print queue lprm Job removal lpr Job submission /etc/printcap — Configuration file Show printer queue: lpq Removing printer jobs: lprm License Of This Document Resources of interest 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc Show printer queue: lpq Printing-HOWTO Printing-Usage-HOWTO Removing printer jobs: lprm License Of This Document lpc — Printer Control 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc lpc examples lpc Is used to control a printer or print job Can be run interactively. Usage is: lpc [ command [ argument ]] lpc commands Show printer queue: lpq Removing printer jobs: lprm License Of This Document lpc — Printer Control 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Example 1 — Non Interactive: $ lpc status ← Printer lp@Node4 Printing Spooling Jobs enabled enabled 0 Objective Resources Printer control with lpc lpc examples Server Subserver lpc commands none none printer queue: Show lpq Removing printer jobs: lprm License Of This Document Example 2 — Interactive $ lpc ← lpc> status Printer lp@Node4 lpc> quit Printing Spooling Jobs enabled enabled 0 Server Subserver none none 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. 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc lpc examples lpc commands Show printer queue: lpq Removing printer jobs: lprm License Of This Document lpq — Display Printer Queue 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc 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. Usage is: $ lpq [-P printer] [Job-id] Show printer queue: lpq lpq example Removing printer jobs: lprm License Of This Document lpq — Example 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective 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 ... Resources Printer control with lpc Show printer queue: lpq lpq example Removing printer jobs: lprm License Of This Document lprm — Remove job(s) from Queue 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc Show printer queue: lpq Removing printer jobs: lprm lprm example lprm is used to remove jobs from a queue jobs can be removed by: by job-id (use lpq to find out) by user Usage is: # lprm [-P printer] [Job-id ...] [user ...] License Of This Document lprm — Example 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources 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 Printer control with lpc Show printer queue: lpq Removing printer jobs: lprm lprm example License Of This Document Topics Covered Context Objective Resources Printer control with lpc lpc examples lpc commands Show printer queue: lpq lpq example Removing printer jobs: lprm lprm example License Of This Document 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources Printer control with lpc Show printer queue: lpq Removing printer jobs: lprm lprm example License Of This Document License Of This Document 1.107.2 Manage printers and print queues Weight 1 Andrew Eager Context Objective Resources 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. Printer control with lpc Show printer queue: lpq Removing printer jobs: lprm License Of This Document