Information regarding printing files on a Unix system.
The command to send files to the printer is "lpr". If you have a Unix file named "myfile" type:
Since you'll want to send your files to a printer close to you, you will need to specify the name of a particular printer i.e adding a "-P" with the printer's name. (Printer names are posted on or near the printer in question.)
For example: if you want to print to Laser35, in the Center Hall 315 Mac lab, you need to specify this to the system.
lpr -Plaser35 myfile
If you know that you'll be doing a lot of printing during one login session, you can shorten what you need to type each time to print. You can change this default to anything you want by typing this command at the prompt:
% setenv PRINTER printername
When you type this, change "printername" to the name of the printer in question.
After that, whenever you type "lpr myfile" during this login session, all printouts will be sent to the printer you specified.
If your print job does not appear at the printer in a reasonable amount of time, DO NOT send it repeatedly. For guidance, see the accompanying section "What to do if your job does not appear."
If your print job does not appear on the printer in a reasonable amount of time, DO NOT send it repeatedly. Chances are, if your job didn't print the first time, it won't print again. Sending the job again will only produce the same result and may in fact aggravate the problem. Instead, follow these steps first:
If several jobs are sent to a printer, the first one received starts to print immediately and the remaining are placed in a queue. To see the current list of jobs that are waiting to print on any given printer (apm2337, in this example), use the following command:
% lpq -Papm2337
If you do not use the "-P" option, and you have set the PRINTER environment variable, then lpq will show you the queue for that printer.
To cancel the printing of a specific job that you have sent to a printer, you first need to check the queue of that printer and get the job number. Once you have that, use the lprm command to remove the job.
[The following example has running comments in square brackets
% setenv PRINTER laser1 [only necessary once per session] % lpr jedimindtricks.txt [print the file] % lpq [show the queue]
[Find your name in the "Owner" column (it's okenobi in this example) ]
laser1 is ready and printing Rank Owner Job Files Total Size 1st hsolo 432 blueprint.html 13344 bytes 2nd okenobi 599 jedimindtricks.txt 6152 bytes
[remove the job using the number in the "Job" column]
% lprm 599
To remove all of your jobs on a specific printer queue, use a '-' as the "job number."
% lprm - [if PRINTER is set appropriately] % lprm -Plaser1 - [to specify a specific printer]
For further information about basic printing commands see:
man lpr man lpq man lprm man lp