HP-UX Printer Management
First, a warning: if you’ve been looking at the Linux printer information elsewhere on this site, stop (unless you’re interested in Linux). Here’s why:
HP-UX is a System V Unix. Thus it uses lp rather than lpr as its print facility (unlike Linux, for instance.) See this HP IT Resource Center thread for more on this subject.
Administrators can consult The HP-UX System Administrator’s Guide for a thorough discussion, “Administering the LP Spooler.”
http://docstore.mik.ua/manuals/hp-ux/en/5992-4616/ch04s01.html
Geeks will like the Freelab.net AIX/HP-UX Interoperability Guide for a deep technical discussion of print operations under HP-UX:
http://www.freelab.net/unix/hp-ux/chap08_print.html.
Users seeking simple answers should check below. If you’re a user, rather than a sysadmin, what printer management you do will likely be entirely from the command line.
Task | Command | Examples/Comments |
Print to your default printer | lp document |
What happens: printer1-4523 |
Print to another printer | lp -dprinter_name document | There must be no space between the -d (destination) and the printer name. |
List your print jobs | /usr/bin/lpstat | Use this to list your print jobs and their request ID, for instance to cancel one. |
Cancel a print job | /usr/bin/cancel job_number | The print job number looks like: printer1-4523 |
Cancel all print jobs for your user on a specific printer | /usr/bin/cancel -a printer_name | A user can only cancel their own jobs, unless they’re superuser. |
Determine lp spooler status | /usr/bin/lpstat -r |
What happens: spooler is stopped |
Display lp spooler activity statistics | lpana | Only useful to sysadmins |
Alter a print request | lpalt | See the man page for details. |
Set a default printer | setenv PRINTERDEST=”printer_name“ | You should set this in your profile files. |
Allow print requests to be submitted to the request directory of a printer | /usr/lib/accept printer_name | This “turns on” the print queue for a single printer. |
Refuse to allow print requests to be submitted to the request directory of a printer | /usr/lib/reject printer_name | |
Enable a printer to actually print | /usr/bin/enable printer_name | This enables literal printing on a single printer. |
Disable a printer from printing | /usr/bin/disable printer_name | |
Start the lp spooler (the scheduler) | /usr/lib/lpsched | This starts actual spooling, i.e. job scheduling and processing. |
Stop the lp spooler (shut it down) | /usr/lib/lpshut |
Printer Directories | |
Printer Descriptions Directory | /etc/lp/* |
Printer Spool Directories | /var/spool/lp/* |