ARCHIVED: In Mac OS X, how do I use Unix commands to print to a PostScript printer?
This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.
To print to a PostScript printer from the Mac OS X Unix prompt, use the lpr command.
Note: For these instructions, you must have root access to your computer. You don't need the root user enabled, but you must know the root password. Also, your printer must support LPR printing over TCP/IP, and you must know its domain name or IP address.
To set up your printer (substitute vader.empire.gov
with your printer's domain name or IP address):
- Become the root user. At the prompt, enter:
su
When prompted, enter the root password.
- Create a personal
printcap
file in your own account, and include an entry for your computer:vader:\ :lp=:rm=vader.empire.gov:rp=lp:sd=/var/spool/lpd/vader:\ lf=/var/log/vader-errs:
- At the Unix prompt, create the spool directory for your printer:
mkdir -p /var/spool/lpd/vader
- Create the sequence number file in the printer's spool directory:
touch /var/spool/lpd/vader/.seq
- Create the error log file for the printer:
touch /var/log/vader-errs
- Set the owner and group to root and daemon, respectively, for the
spool directory, the sequence number file, and the error log file:
chown -R root.daemon /var/spool/lpd/vader /var/log/vader-errs
- Set the permissions on the error log file to world readable:
chmod 644 /var/log/vader-errs
- Load your printcap entry into NetInfo:
niload printcap / < /etc/printcap
- Launch the Print Center (in
/Applications/Utilities
). - Click .
- In the sheet that appears, select from the pop-up menu.
- Click your printer's name, and then click .
To print the PostScript document thesis.ps
from the
command line, enter:
lpr -Pvader thesis.ps
This is document aklx in the Knowledge Base.
Last modified on 2018-01-18 13:02:23.