University of Calgary
UofC Navigation

Stay Connected

I Need Help With...

Contact

Technical Support

Help Desk Location:
Math Sciences 151
University of Calgary
View Map

Help Desk Hours:
Monday - Friday
8:30am - 12:00pm
1:00pm - 4:30pm

T. 403.220.6613
E. scihelp@ucalgary.ca

Submit a Support Ticket: help.science.ucalgary.ca

Unix Printing Commands

Note that the default printer is ugl for all users unless otherwise specified by way of setting the PRINTER environment variable, ie. "setenv PRINTER lj5" or by way of specifying a specific printer via the -P option with any of the following printer commands.

Print a file: lpr

To print a file, use lpr:

> lpr filename

To specify a different printer, use the -P flag followed immediately by the printer name:

> lpr -Plj5 filename

To send laser printer jobs duplex (double-sided), use the -D option:

> lpr -D myfile.ps

To send laser printer jobs without a header page, use the -h option:

> lpr -h myfile.ps

To send a job to a specific printer, duplex with no header page, combine the above options:

> lpr -h -D -Plj5 myfile.ps

Check the print queue: lpq

Note that lpq does not report information for the UG laser printer pool (ugl) due to FOIP regulations. Jobs sent to ugl may only be viewed by the owner of the jobs via the print release stations in the main lab.

To check the print queue, use lpq:

> lpq -Pprinter

Printer:
printer@print ' Printer Description'
Server: active
Rank Owner Job Files Total Size
1 user 80 filename 717 bytes

Remove jobs from the queue: lprm

Note that lprm does not remove jobs queued to UG laser printer pool (ugl). Jobs must be deleted from the hold queue by the owner via the print release stations in the main lab.

To remove one of your jobs from the queue, use "lprm" and the job ID number. You can be obtain the ID number from "lpq" (see previous example):

> lprm -Pprinter 80

Printer
printer@print:
checking perms 'cfA080host'
dequeued 'cfA080host'

To remove all your jobs from the queue, use "lprm" and your username:

> lprm -Pprinter user

Printer
printer@print:
checking perms 'cfA080host'
dequeued 'cfA080host'

Quota and Printer information: lpinfo

To list your printer access list and your laser printer quota, use lpinfo

> lpinfo

user can print to:
ugl UG Lab UG Release Queue [man hp8000]
lj5 ICT 624 HP LaserJet 2200DN [man lpr]
user has printed 10 of 100 pages

Please refer to the lpr, lprm, lpq and lpinfo manpages for addition information.