Section 15.3. Objective 3: Print Files


15.3. Objective 3: Print Files

The ability to manage your printers and print queues isn't very helpful until you actually need to print files . LPI 102 covers the lpr command to send jobs to the lpd daemon for printing. You can also use a combination of lpr with mpage to manipulate your print jobs to print multiple pages to a single sheet of paper.


Syntax

 lpr [options] [files] 


Description

Send files or standard input to a print queue. A copy of the input source is placed in the spool directory under /var/spool/lpr until the print job is complete.


Frequently used options


-#number

Send number copies of the print job to the printer.


-s

Instead of copying a file to the print spooling area, make a symbolic link to the file instead, thereby eliminating transfer time and storage requirements in /var/spool/lpr for very large files.


-Pname

Specify the print queue name. In the absence of -P, the default printer is queried.


Example 1

Print the file /etc/lilo.conf on the default print queue:

 # lpr /etc/lilo.conf 


Example 2

Print a manpage by piping to lpr's standard input:

 # man -t 5 printcap | lpr 


Example 3

Disable a print queue:

 # lpc disable lp 

Then attempt to print three copies of a file to the disabled queue as superuser:

 # lpr -#3 /etc/lilo.conf 

Success, despite the disabled printer queue. Now try as a regular user:

 $ lpr -#3 ~/resume.txt lpr: Printer queue is disabled 

As expected, normal users can't print to the disabled queue.

On the Exam

You must be familiar with lpr and its use with both files and standard input. Also remember that lpr doesn't send data to the printer, but to lpd, which handles sending it to the printer.



Syntax

 mpage [options] [files] 


Description

The mpage command reads plain text (or PostScript) files and manipulates the text size to fit multiple print pages on single sheets of paper. This tool requires a PostScript printer to print the results.


Frequently used options


-#number (1, 2, 4, or 8)

Prints number of normal pages per sheet. mpage supports printing 1, 2, 4, or 8 pages per sheet.



LPI Linux Certification in a Nutshell
LPI Linux Certification in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596005288
EAN: 2147483647
Year: 2004
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net