1. Home
  2. Docs
  3. How do I
  4. Print from Linux?

Print from Linux?

CELS-managed Linux Desktops

How do I set the default printer on a linux box?

If you set the environmental printer variable, you will not need to specify which printer you wish your output to go to each time. This can be set (or reset) in a particular shell; in which case the definition lasts the lifetime of the shell (or until you reset it). The printer variable can also be set in your shell’s initialization file (for example, the .tcshrc if you use tcsh). In either location, type

         setenv PRINTER printer_name

If you’re not sure what your current default printer is, you can check by giving the command:

         printenv PRINTER

How do I print a file from linux?

If you are using a Ubuntu Linux desktop, you should able to print directly from most applications. Debian Sarge desktops are hit or miss. In any case, printing from the command will work.

Plain text files (ones you can read) can be printed using enscript. Enscript converts these files to postscript format and then sends them to the specified printer. For example, where PRINTER is set,

         enscript foobar

will print the file. See man enscript for a complete explanation.

Files already in postscript format (generally end in “.ps” and are “gibberish” if you read them) can be printed using lpr. (A file is determined to be a postscript file if the first two characters are “%!”.) For example, to print file foobar.ps on pr-d255 — (where PRINTER is not set)

         lpr -Ppr-d255 foobar

Dvi files (end in “.dvi” and are also “not readable”) must be turned into postscript before printing. dvips converts dvi files into postscript. (See man dvips for more information.) Therefore, to print the file “foobar.dvi”, do

         dvips foobar.dvi

which will generate a foobar.ps file. (Then see info on printing postscript files.)

I printed my file in linux, but it hasn’t come out of the printer yet. What’s up?

First, check to see if the file is still in the print queue (hasn’t been printed yet because people are ahead of you). For example, to check pr-d255 to see that Riley’s job is still in the queue.

         juju.mcs.anl.gov> lpq -Ppr-d255
         pr-d255_local is ready and printing
         Rank   Owner      Job  Files                          Total Size
         active riley       200  /usr/tmp/ESa21345              1656725 bytes

If the file has been printed, your job may be sitting on the table or the shelves around the printer. Mainly, just look around. If you still can’t find it, try again. If you think there are problems with the printer, email systems@mcs.anl.gov.

Please recycle any unwanted printouts. The recycling bin is right inside the door to the printer room.

Oops. I sent a file to the printer, from linux, I didn’t mean to

Use lprm to remove jobs from the printer queue, using the job id given under an lpq. So, for this job

         juju.mcs.anl.gov> lpq -Ppr-d255
         pr-d255_local is ready and printing
         Rank   Owner      Job  Files                          Total Size
         active riley       200  /usr/tmp/ESa21345              1656725 bytes

you would type, and receive:

         juju.mcs.anl.gov> lprm -Ppr-d255 200
         sunset.mcs.anl.gov: dfA200juju.mcs.anl.gov dequeued
         sunset.mcs.anl.gov: cfA200juju.mcs.anl.gov dequeued

Self-managed Linux computers

You need to be running CUPS on your local machine.  Installing that and configuring it is outside the scope of this document, and presumes anyone running their own Linux laptop is capable of getting to this point.

  • Visit your local cups config at http://localhost:631
  • Choose Add Printer
  • Use the format ipp://printers-240.anl.gov/printers/NAME where NAME is the name of the printer you want to add (e.g. pr-2d11-color)
  • Use the PostScript driver, since the server will be handling communication with the printer

If you receive an “Unauthorized access” error when adding a printer in cups, modify the following fields in /etc/cups/cupsd.conf

<Location /admin>
Order allow,deny

<Location /admin>
AuthType Default
Require user @SYSTEM
Order allow,deny

Followed by running “sudo service cups restart”

The list of common CELS printers in 240:

Printer NameFloorLocationModelNotes
Filmore11F8Canon IR 5535Color
CrystalLake11180 (West Oasis)Canon IR 6565Fax, B/W
DaltonCity11144 (Near vending)Canon IR 4535
Famersville22D11Canon IR 5535Color
KlamathFalls2(West Oasis)Canon IR 4535B/W
Countryside33168 (East Oasis)Canon IR 6565Fax, B/W
EllisGrove33180 (Center Oasis)Canon IR 5535Color
LaCrosse3(West Oasis)Canon IR 5535
Dakota44165 (East Oasis)Canon IR 6565B/W
Enfield44171 (Center Oasis)Canon IR 5535Color
Olympia4(West Oasis)Canon IR 5535
Dekalb55168 (East Oasis)Canon IR 4545Fax, B/W
Compton55185Canon IR 5535
NiagaraFalls55C5Canon IR 5535
Brainard66A20Canon IR 4535
Mobridge66C7Canon IR 5535
Oshkosh66D22Canon IR 5535
Kayenta77E17Canon IR 5550
Pocatello77D23Canon IR 6565
Was this article helpful to you? Yes No

How can we help?