OnWorks Linux and Windows Online WorkStations

Logo

Free Hosting Online for WorkStations

< Previous | Contents | Next >

lp – Print Files (System V Style)

Like lpr, lp accepts either files or standard input for printing. It differs from lpr in that it supports a different (and slightly more sophisticated) option set. Here are the com- mon options:


Table 22-3: Common lp Options


Option Description

Option Description

-d printer Set the destination (printer) to printer. If no d option is specified, the system default printer is used.


image

-n number Set the number of copies to number.


image

-o landscape Set output to landscape orientation.


image

-o fitplot Scale the file to fit the page. This is useful when printing images, such as JPEG files.


image

-o scaling=number Scale file to number. The value of 100 fills the

page. Values less than 100 are reduced, while values greater than 100 cause the file to be printed across multiple pages.


image

-o cpi=number Set the output characters per inch to number.

Default is 10.


image

-o lpi=number Set the output lines per inch to number. Default is

6.


image


image

-o page-bottom=points

-o page-left=points

-o page-right=points

-o page-top=points

Set the page margins. Values are expressed in points, a unit of typographic measurement. There are 72 points to an inch.


image

-P pages Specify the list of pages. pages may be expressed as a comma-separated list and/or a range. For example “1,3,5,7-10”


image


We’ll produce our directory listing again, this time printing 12 CPI and 8 LPI with a left margin of one half inch. Note that we have to adjust the pr options to account for the new page size:



[me@linuxbox ~]$ ls /usr/bin | pr -4 -w 90 -l 88 | lp -o page-left=36

-o cpi=12 -o lpi=8

[me@linuxbox ~]$ ls /usr/bin | pr -4 -w 90 -l 88 | lp -o page-left=36

-o cpi=12 -o lpi=8


This pipeline produces a four-column listing using smaller type than the default. The in- creased number of characters per inch allows us to fit more columns on the page.


Top OS Cloud Computing at OnWorks: