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.

lpr

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.

-P name

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.

mpage

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset