1.107.3 Print files Weight 1 Andrew Eager 1.107.3 Print files Weight 1 Linux Professional Institute Certification — 102 Context Objective Resources lpr lpq a2ps mpage License Of This Document Andrew Eager andrew.eager@aes-pl.com.au Geoff Robertson Nick Urbanik This document Licensed under GPL—see section 8 2005 July Outline 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr lpq a2ps Context Objective Resources lpr lpq a2ps mpage License Of This Document mpage License Of This Document Topic 107 Printing [3] Where we are up to 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr lpq a2ps mpage 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] License Of This Document Description of Objective 1.107.3 Print files 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr lpq 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. a2ps mpage License Of This Document Key files, terms, and utilities include: 1.107.3 Print files 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr lpq a2ps lpq Display Print queue lpr Job submission mpage Print multiple pages per sheet mpage License Of This Document Resources of interest 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr lpq a2ps mpage Printing-HOWTO Printing-Usage-HOWTO License Of This Document lpr — Submit job to Print Queue 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr is used to submit a job to the print queue lpr can be run from the command line lpr assumes text is to be printed by default lpr uses /etc/printcap for printer settings 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 ← lpr lpq a2ps mpage License Of This Document lpq — See print jobs in queue 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr lpq a2ps mpage lpq displays the jobs in either the default printer queue, or a specified one License Of This Document man lpq lpq(1) NAME 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) Easy Software Products lpq(1) 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr lpq a2ps mpage License Of This Document SEE ALSO cancel(1), lp(1), lpr(1), lprm(1), lpstat(1) CUPS Software Users Manual, http://local- a2ps — Convert ASCII to Postscript 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr 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 Usage: a2ps [-o out-file] in-file Example: $ a2ps -o myfile.ps myfile.txt ← $ cat myfile.ps > /dev/lp0 ← lpq a2ps mpage License Of This Document mpage — Print multiple pages per page 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr 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 Usage: mpage [-1248] [options] input-file ... Example: Print 4 pages per page on A4 $ mpage -4 -b A4 bigfile.ps | lpr ← lpq a2ps mpage License Of This Document Topics Covered Context Objective Resources lpr lpq a2ps mpage License Of This Document 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources lpr lpq a2ps mpage License Of This Document License Of This Document 1.107.3 Print files Weight 1 Andrew Eager Context Objective Resources 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. lpr lpq a2ps mpage License Of This Document