Although we sometimes say a command ``prints'' out a message, most
likely the output is appearing on a terminal screen and not on a piece
of paper (where respectable printing belongs). There is still power
and value in the printed word, and for this purpose a line or page
printer is usually attached directly or through a network to your
system.
When you give the print command lpr, your print job is placed in the printer queue. If the printer is set and working properly, it will print out your job in turn. To check the status of your print job and to determine its print job number, use the lpq command. To stop a job from printing (say because you submitted the Encyclopedia Britannica by mistake, or because the printer is chewing up your output), try the command lprm or cancel, followed by your job number. Stopping a print job by turning off the power to the printer will certainly stop the printing, but it may disable the printer from further use by the system or confuse a (not so) smart printer or printer spool, or both. The printer can be enabled with the lpc or enable command, but it may take some system work to get the print spooler program working again.
As an example, here we see bohr finally getting his name in print:
% cd class | Change to directory class. |
% ls | |
prog.f | One lonely Fortran program. |
% lpr prog.f | Print prog.f on line printer. |
% lpq | Tell me files being printed. |
lp is ready and printing | |
Rank Owner Job Files Total Size | |
active fink 93 guide 367229 bytes | |
first bohr 94 prog.f 429 bytes | |
% lprm 94 | Stop printing prog.f. |
The printer is busy so try elsewhere. | |
% lpq -Pmath | Check the math dept.'s printer. |
no entries | OK, it's idle. |
% lpr -Pmath prog.f | Send the file to be printed. |
math is ready and printing | |
Rank Owner Job Files Total Size | |
active bohr 86 prog.f 429 bytes | Ah, it's printing. |