43.2 Introduction to Printing on UNIXPersonal computers often have dedicated printers. A dedicated printer is connected to your machine and only you can use it. You can send it only one print job at a time and have to wait until the printing finishes before you can go back to work. UNIX uses a print spooler to allow many users to share a single printer. A user can make a printing request at any time, even if the printer is currently busy. Requests are queued and processed in order as the printer becomes available. UNIX permits multiple printers to be connected to the same system. If there is more than one printer, one printer is set up as the default printer and print jobs are automatically sent there. 43.2.1 System V Printing CommandsIn System V, the lp command is used to queue a print job. (Berkeley systems' printer commands are explained below.) When you use lp , it spools the file for printing and returns the request id of your print job. The request id can later be used to cancel the print job, if you decide to do so. $ The lpstat command can be used to check on the status of your print jobs. The lpstat command will tell whether your job is in the queue. $ The message $ The lpstat command can be used to determine what printers are connected to your system and their names. If there is more than one printer, you can then use the -d option with lp to specify a printer destination other than the default. For instance, if a laser printer is configured as laserp , then you can enter: $ 43.2.2 Berkeley Printing CommandsBSD UNIX uses the lpr command to queue a print job. When you use lpr , it spools the file for printing. $ Unlike System V lp , the lpr command doesn't print a request id. If you need to kill the job, use lpq first. The lpq command tells you the status of your print jobs. $ The word You can remove a job with the lprm command. (First, run lpq to get the job number.) $ The command lpc status (43.3 ) can be used to determine which printers are connected to your system and their names. If there is more than one printer, you can then use the -P option with lpr to specify a printer destination other than the default. For instance, if a laser printer is configured as laserp , then you can enter: $ The -P option also works with lpq and lprm . If you'll be using a certain printer often, put its name in the PRINTER environment variable (43.4 ) . - , , |
|