Campuses:
Printing on Linux is handled through CUPS utilizing the cups.cse.umn.edu print server
The command to print from a Unix system to any of our network printers is:
lpr -P printer filename
…where printer is the name of the print queue (usually the room number). The queues accept many (but not all!) file types directly, such as image files and PDF as well as text or Postscript. Application-specific files such as HTML web pages, Mathematica workbooks, etc, have to be printed from within the application.
You can use the lpstat(1) command to see a list of available printers:
lpstat -a
If you want to use the GUI printing configuration utility under Settings→Printers rather than lpoptions as described below, they will overwrite and lose any settings you have made manually. Please just use one of the two methods to change options.
Additional print options can be specified to select features such as duplex or portrait/landscape orientation. A huge number of options is available, and you should consult the CUPS manual for complete details, but some example options include:
-o media
switch. For example:lpr -o media=Upper filename lpr -o media=Lower filename
-o sides
switch.lpr -o sides=two-sided-long-edge filename lpr -o sides=two-sided-short-edge filename lpr -o sides=one-sided filename
-o landscape
switch.lpr -o portrait filename lpr -o landscape filename
Some of these options are quite wordy; however you can use the lpoptions
command to set up default settings to suit your preference (see the CUPS user manual for details). To view the available options, and their current settings for a particular printer, use the lpoptions -l
command - for example,
lpoptions -p 216 -l
The above “generic” options such as sides=two-sided-long-edge
may not work for setting defaults. Instead, find the specific option for your printer from lpoptions -p printer -l
, and use that. For example the option to set duplex printing on the 431 HP printer may be something like lpoptions -p 431 -o Duplex=DuplexNoTumble
.
If you want to select a particular printer as default, use the lpoptions -d
command. You can then use this printer without having to use the -P
parameter. For example:
lpoptions -d 216
NOTE in the past, one would set the default printer by setting an environment variable PRINTER
in your login script. You should remove any such setting in order to avoid unexpected interactions.
You can check the contents and status of a print queue using the lpstat
command. For example,
lpstat 216
You can check queue and job status online by checking the print server jobs listing (this link will only work within Tate Lab).
To print to the Toshiba color copiers in PAN, MIFA and FTPI, you need to specify your Department printing code. This is tedious to specify on the CUPS command line, but it can be done using the DCDigit1… DCDigit5 options.
Say your Department Code is 10203. Your command to print would be:
lpr -P 358c -o DeptCode=True -o DCDigit1=1 -o DCDigit2=0 -o DCDigit3=2 -o DCDigit4=0 -o DCDigit1=5 filename
You can avoid having to specify the code every time, by storing it using lpoptions
. For example, to first store your code and then print a file:
lpoptions -o DeptCode=True -o DCDigit1=1 -o DCDigit2=0 -o DCDigit3=2 -o DCDigit4=0 -o DCDigit5=3 -p toshiba-pan-311 lpr -P toshiba-pan-311 filename
Note there are several possible places for your output to be delivered; you can control this using the OutputTray option. The default is the Inner tray (beneath the control panel).
<note warning>
</note>
You can print to our print queues from a remote unix system, by piping your file through the “ssh” command. For example:
bash> cat myfile.ps |ssh ssh.physics.umn.edu "cat - |lpr -P342"
If you often need to print from a remote site, it should be fairly simple to embed these commands into a convenient script or alias. For example, if you use tsch:
tcsh> alias lp342 'cat \!\!:1 | ssh ssh.physics.umn.edu "lpr -P342"' tcsh> lp342 myfile.ps
Or bash:
$ lp342() { cat $1 |ssh ssh.physics.umn.edu "lpr -P342" } $ lp342 myfile.ps