What are the general options I can pass, via the lp command, to the printer, from the command line prompt, on Linux or Mac OS X?
Use the -d option with the lp command to print to a specific printer:
lp -d printer filename
The -o sides=two-sided-short-edge and -o sides=two-sided-long-edge options will enable duplexing on the printer, if the printer supports it. The -o sides=two-sided-short-edge option is suitable for landscape pages, while the -o sides=two-sided-long-edge option is suitable for portrait pages:
lp -o sides=two-sided-short-edge filename lp -o sides=two-sided-long-edge filename
Our acslp2 printer is already set to do duplex (long-edge) printing. To force "one-sided" printing, use the following command:
lp -o sides=one-sided filename
The -o number-up=value option selects N-Up printing. N-Up printing places multiple document pages on a single printed page. CUPS supports 1-Up, 2-Up, and 4-Up formats:
lp -o number-up=1 filename lp -o number-up=2 filename lp -o number-up=4 filename
The default format is 1-Up.
The -o page-ranges=pages option selects a range of pages for printing:
lp -o page-ranges=1 filename lp -o page-ranges=1-4 filename lp -o page-ranges=1-4,7,9-12 filename
As shown above, the pages value can be a single page, a range of pages, or a collection of page numbers and ranges separated by commas. The pages will always be printed in ascending order, regardless of the order of the pages in the page-ranges option.
The default is to print all pages.
Use the -o page-set=set option to select the even or odd pages:
lp -o page-set=odd filename lp -o page-set=even filename
The default is to print all pages.
The -o prettyprint option puts a header at the top of each page with the page number, job title (usually the filename), and the date. Also, C and C++ keywords are highlighted, and comment lines are italicized:
lp -o prettyprint filename
The -o landscape option will rotate the page 90 degrees to print in landscape orientation:
lp -o landscape filename
For more information, please see: