| ACADEMIC COMPUTING and COMMUNICATIONS CENTER | |||||||||
Unix 101: Printing | |||||||||
|
|||||||||
| Introduction | |||||||||
|
While Unix command names tend to be very terse, the Unix operating system is anything but. Want to print something? The Unix command apropos lists available Unix commands by keyword. (As does the equivalent command: man -k ) So what happens when you enter: apropos print | more on tigger? It lists 109 commands, all of which have something to do with printing. Whew! Fortunately, it's easier to actually print. Here's a quick guide. Remember: case matters on Unix. So enter all commands in the case shown. (Almost everything is in lowercase, so a good rule to go by is always use lowercase unless otherwise specified.) Also note: Unix printing software can generally tell the difference between plain text files and PostScript files, so you usually can print either type without specifying other options. On the other hand, though, the lpr command has many options that allow you to specify the format you want for your printed output. Enter man lpr for details. |
|||||||||
| Printing on tigger and icarus | |||||||||
|
lpr is the basic Unix print command on tigger and icarus: lpr -P uprint .newsrc The -P flag allows you to specify a printer, uprint in this case, or, if you'd rather, you can select a default printer. .newsrc and hello.ps are the files being printed; lpr can print either plain text or PostScript files, and, in most cases, can even tell the difference. lpr has several other flags; take a look at its man page for more information. In fact, you might want to print a copy: man lpr | lpr -P printer Substitute the name of a convenient printer -- one that Unix knows about (see Listing the Available Printers) -- for the printer; for the most part, you'll be using uprint. |
|||||||||
| Listing the Available Printers | |||||||||
|
The basic Unix command to check printer queues, and, incidentally, to list the names of the printers that the Unix system knows about, is lpstat. To display the status of all print queues:
Don't think that an empty printer queue necessarily means an idle printer; these Unix commands only know about Unix print jobs; print jobs may also come from other machines on the UIC network. |
|||||||||
| U-Print and Printing Charges | |||||||||
|
For most people, most semesters, there is no monetary charge made for printing on ACCC printers. However, one of the principle goals of our new printing system, U-Print, is to reduce waste. U-Print does this both by allowing you to cancel jobs you don't want printed and by charging for all printing done over a generous per-person, per-semester printing quota. To print to U-Print, select the printer: uprint Your U-Print job won't be printed until you login to the U-Print station of the printer you've chosen or of any compatible printer, and direct it to be printed. For more on U-Print and a list of Unix printer destinations that are in the U-Print system (most of them are), see Printing at the ACCC. For details, see the U-Print Web page: U-Print: The New ACCC Public Printing System. |
|||||||||
| Making Printing Easier | |||||||||
| -- Selecting a Default Printer | |||||||||
|
To select a default printer, set and export the shell variable PRINTER. Enter the following commands at the $ command prompt:
This sets the default printer to uprint; you can use any printer listed by lpstat. To have these commands executed each time you login and each time you open a new shell, put them in your .profile file. Profile files are introduced in Using Unix: Customizing Korn Shell. Exporting the shell variables allows them to be known in subshells. |
|||||||||
| -- Setting Command Aliases for Printing | |||||||||
|
Can't remember "qchk" or "lpstat DP"? I can't either. But I can remember the command printers. So I set a command alias in the Korn shell (see "What Unix shell are you using?") which allows me to enter the command printers to check the print queues. (That's particularly useful in this case, where different Unix systems expect different commands.) Create a file in your home directory named .env, and in it put the line:
Then create a file in your home directory named Profile, and in it put: ENV=~/.env .profile and .env files are introduced in Using Unix: Customizing Korn Shell. |
|||||||||
| -- If you're on tigger and you'd rather use a menu | |||||||||
|
Then use the print command qprt through smit, the AIX "System Management Interface Tool." To submit a print job completely by menu (and to see what smit can do, enter: smit Or enter: smit qprt to go directly to the "Start a Print Job" menu. Another way to use qprt is to enter it as a command on the command line, without smit. When used this way, qprt is a full featured print command (that means it has dozens of flags). The names of the fields in the menu are in a column on the left; the "Entry Fields," where you actually type, are on the right. Use Up or Down to move from field to field. Don't press Enter or Return (except to make a selection from a pop-up window) until you're ready to submit the print job. You must fill in three fields:
Make other changes on the "Start a Print Job" menu if you want; press Enter to submit the print job. Before the submission is complete, you may press F3 to cancel the print job; press F10 to exit. A nice thing about using qprt through smit is that all you have to remember is three fields that you must enter values for; you don't have to remember how to use the menu. There are instructions on the screen and in each pop-up window, and a table at the bottom of the menu showing the keys that execute the necessary functions. In fact, old CMS hands will find that the screen bears a strong resemblance to their favorite full screen CMS menus. |
|||||||||
| Unix 101 | Previous: 4. vi Editor | Next: 6. Printing FAQ |
| 2006-11-28 ACCC documentation |
|