3. Resources lpr Job submission mpage Print multiple pages per sheet 1.107.3 2 1.107.3 Print files Weight 1 Linux Professional Institute Certification — 102 3 Resources Resources of interest Printing-HOWTO Printing-Usage-HOWTO Andrew Eager andrew.eager@aes-pl.com.au Geoff Robertson Nick Urbanik • lpr is used to submit a job to the print queue This document Licensed under GPL—see section 8 4 lpr lpr — Submit job to Print Queue 2005 July • lpr can be run from the command line • lpr assumes text is to be printed by default • lpr uses /etc/printcap for printer settings 1 Context 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] Usage of lpr is: lpr [-P printer ] [-# num ] filename ... Examples: Print /etc/hosts file to spool lp0: $ lpr -Plp0 /etc/hosts ← Print two copies of /etc/hosts file to default print spool: $ lpr -#2 /etc/hosts ← 5 2 Objective Description of Objective Candidates should be able to manage print queues and manipulate print jobs. This objective includes adding and removing jobs from configured printer queues and converting text files to postscript for printing. Key files, terms, and utilities include: lpq Display Print queue lpq • lpq displays the jobs in either the default printer queue, or a specified one lpq — See print jobs in queue 6. a2ps man lpq lpq(1) NAME 1.107.3 3 7. mpage 1.107.3 4 Easy Software Products lpq(1) Usage: a2ps [-o out-file] in-file Example: $ a2ps -o myfile.ps myfile.txt ← $ cat myfile.ps > /dev/lp0 ← lpq - show printer queue status SYNOPSIS lpq [ -E ] [ -P dest ] [ -a ] [ -l ] [ +interval ] DESCRIPTION lpq shows the current print queue status on the named printer. Jobs queued on the default destination will be shown if no printer or class is specified on the command-line. The interval option allows you to continuously report the jobs in the queue until the queue is empty; the list of jobs is show one every interval seconds. The -E option forces encryption when connecting to the server. The -a option reports jobs on all printers. The -l option requests reporting format. a more verbose (long) 7 mpage • mpage will print multiple pages per physical page • Input can be either text or postscript • 1, 2, 4 or 8 pages can be printed per page • Output can be directed to printer or stdout mpage — Print multiple pages per page Usage: mpage [-1248] [options] input-file ... Example: Print 4 pages per page on A4 $ mpage -4 -b A4 bigfile.ps | lpr ← 8 License Of This Document SEE ALSO cancel(1), lp(1), lpr(1), lprm(1), lpstat(1) CUPS Software Users Manual, http://localhost:631/documentation.html License Of This Document Copyright c 2005, 2002 Andrew Eager , Nick Urbanik , Geoffrey Robertson 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. 6 a2ps • Most Unix sites use postscript printers • You can not send an ASCII file directly to a postscript printer • To convert from ASCII to ps, use a2ps a2ps — Convert ASCII to Postscript