DoC Computing Support Group


Your search query "linkto:"guides/printing/linux-commandline"" didn't return any results. Please change some terms and refer to HelpOnSearching for more information.
(!) Consider performing a full-text search with your search terms.

Clear message

Printing from the Linux Command-Line

Printer options

These are the commands that can be used to print to DoC printers from Linux in various formats, using the printer called ICTMono as an example:

        command                 format
        -------------------------------------------------------
        lpr -P ICTMono          normal
        lpr -P ICTMono-1        force single side
        lpr -P ICTMono-1s       top left staple
        lpr -P ICTMono-1ds      staple (2 on left side)
        lpr -P ICTMono-2        duplex (flip on long edge as usual)
        lpr -P ICTMono-2s       duplex, staple top left
        lpr -P ICTMono-2ds      duplex, 2 staples left

On Ubuntu (and any other system that uses CUPS) you can specify further options using the -o flag.

 lpr -P ICTMono -o option file.ps 

Options vary by printer. To list the available options for a given printer run

 lpoptions -d ICTMono -l 

Options can be combined using a seperate -o for each option. For example the first command below would print one-sided with a staple in the top left corner in portrait while the second command would do likewise but for landscape:

lpr -P ICTMono -o HPStaplerOptions=1diagonal -o Duplex=None file.ps
lpr -P ICTMono -o HPStaplerOptions=1diagonal -o HPRotate180=True -o Duplex=None file.ps

Setting your default printer

If you always use the same printer you can set that as your default thus enabling you to use the lpr command without adding the printer name.

To find out your current default printer run the command:

 echo $PRINTER 

This setting will usually be in your .cshrc file. Look for a line similar to the following:

 setenv PRINTER ICTMono 

Duplexing

Printers which are capable of printing on both sides of a sheet of paper should do so by default when selected from Linux or Windows systems. To force the printer to print single-sided from Linux, add -1 to it's name, eg:

 lpr -P ICTMono-1 

(equally, it's possible to add -2 to ensure you force duplex printing).