Finding printers near you

Type lpstat -v at the command line on an apps machine to find a list of printers that you have access to use.

Changing your default printer

To find out your default printer, from the command line, type: echo $PRINTER

To temporarily change your default printer, type: PRINTER=[printer_name]

export PRINTER

Type: echo $PRINTER to make sure that the new printer settings have taken place.

This setting will only last until you logoff.

To permanently change your default printer - find out what shell your using. Type: echo $SHELL

If you are using the default shell /bin/bash you will need to edit the .bashrc file.

****Edit this file at your own risk. Always make a Backup.****

In the .bashrc file repeat the commands you used above to set the printer. These will then take effect every time you log in.

Printing From the command line

lpr print_job will print to your default printer.

For example: lpr [filename] prints a file (substitite the filename for [filename]), to your default printer.

lpr -P [printer_name] [filename] sends a print job to a printer of your choosing.

For Example: lpr -Plw-ba1234 todolist prints todolist to a printer called lw-ba1234.

lpq shows the print queue for your default printer. For example:

    lw-ba1234 is ready and printing
    Rank    Owner   Job     File(s)    Total Size
    active  jerrykr 73514   file.ps    218112 bytes

This shows that the owner jerrykr has a file called file.ps in the print queue. It is job number 73514.

lpq -P [printer_name] shows the print queue for a specified printer.

For example: lpq -Plw-ba1234 shows the print queue for a printer called lw-ba1234.

lprm [job#] removes a job from the print queue. You can only remove jobs from the print queue that you have sent.

For example: to cancel the document file.ps in the above lpq example, I would see that the job number was 73514 and type lprm 73514

Printing PDFs

To view PDF documents type: evince [filename] (this assumes you have a local X-windows server and are tunneling X). To print from within evince select File on the top left corner and from the drop down menu select Print.

Problematic PDF Documents

There are some PDF documents that for some reason will not print properly from linux. This is typically a font incompatibility. If this occurs try the pdf2ps binary which converts PDF documents to postscript.

From the command line type: pdf2ps [filename.pdf] [filename.ps]

This renames and converts a PDF file to postcript. Make sure you use the .pdf and .ps extensions when you type the name of the documents.

For example: to convert a file called test.pdf to a file called test.ps you would type: pdf2ps test.pdf test.ps

Once the file has been converted to postscript use the lpr command from a command line to print the document.