CMPSC 311, General Instructions
Using the Printer in 218 IST
The printer in 218 IST is named
= HP LaserJet). If it
isn't working, you can use the printer in 220 IST, which is
the toner is low, or there's no paper, or there are other problems
that need attention,
send mail to
Print requests go into a queue. You can see the queue with the
command, and remove one of your own print requests with the
command. You can see the status of the printer with
lp = line printer, an ancient technology)
lpq -P lj218
lpstat -p lj218
lpq uses uppercase
-p. Most commands designating a
printer use uppercase
lpr are used to submit
print requests, but usually you want some kind of formatting to be done
The big blue trash barrel is for paper recycling, the smaller gray
trash barrel is for other stuff.
To print from Firefox,
Note that the Properties / Print Command is sticky - if you are in
another CSE lab, you will need to change the printer selection.
- Click on File / Print, or, type control-P, or, click on the
printer icon on your Navigation Toolbar (click on View / Toolbars /
Customize to install this)
- This will bring up a Print dialog box.
- Click on Printer / Printer Name / Properties and enter the
lpr -P lj218
- Click on GrayScale (
lj218 is a b/w printer)
- Click on OK
- You should be back to the Print dialog box, so click on Print.
To print a plain-text file, we recommend the command
enscript -P lj218 filename
assuming you are in 218 IST and want to use the printer in that
room. (We will need to modify the command shortly.)
enscript program will place a header line at the top
of the page, with the file's name and last modification date, and the
current page number.
Another good program for printing plain-text files is
a mnemonic for "ASCII to Postscript".
a2ps -P lj218 filename
The header used by
a2ps includes more information than is
landscape mode by default,
and understands most programming languages well enough to format them
neatly. For example, keywords in C are in bold letters, comments
are in italic, and character strings are in a variable-width
font. But you need good eyes; the default font size is pretty
Check the man pages for
for more details, or run
for a reminder of the options.
Suppose the printed header from
enscript is missing or
seems to be incomplete, showing only the bottom of each letter.
It's also possible that the last line of the printed page is
incomplete, showing only the top of each letter. What is the
cause of this problem, and how do you fix
it? From the
enscript man page, in the section
describing the command-line options,
-M name, --media=name
output media name. Enscript's
names of all known output media and exit
The output from
enscript --list-media is
lly urx ury
So, issue this command instead:
enscript -M Letter -P lj218
The international standard A4 paper is longer and narrower than the US
standard Letter paper, which is why
a2ps seemed to be
cutting off lines at the top and bottom of the page.
The selection of A4 as the default size is made in the file
More later ...
- How to make an alias for a print command, so you can type less
Last revised, 18 Aug. 2011