book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!







This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open Desktop or Openserver.

There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

Printing FAQ

How can I add, modify or remove printers from the command line?

The "lpadmin" command can add or modify printers without using SCOAdmin or "mkdev lp":


Hate these ads?



 /usr/lib/lpadmin -p printer1 -v /dev/lp -m HPLaserJet
 /usr/lib/accept printer1
 enable printer1
 /usr/lib/lpadmin -d printer1


 


adds a new printer named "printer1" which prints to the parallel port and uses the "HPLaserJet" model. "lpadmin -d" makes it the default printer.


 /usr/lib/lpadmin -x printer1 


 


removes the printer "printer1".

There are other options to lpadmin; see the man page.






Xenix printers can be transferred with a script like this (which assumes that the Xenix hierarchy is located under "/xenixsys"):



 cd /xenixsys/usr/spool/lp/member
 for i in *
 do
 # make sure we aren't overwriting an existing model
 if test -r /usr/spool/lp/model/$i
 then
        echo "Model $i already exists"
 else
        cp ../interface/$i /usr/spool/lp/model
        /usr/lib/lpadmin -p $i -v `cat $i` -m $i 
        /usr/lib/accept $i
        enable $i
 fi
 done


 


If you modify interfaces or devices of existing printers with lpadmin, you will have to do "/usr/lib/lpshut;/usr/lib/lpsched" to see the effects.





ad

Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner

cartoon
Need eyes on the ground at your customer's site?
Installation and light training Boston and New England
Reliable and experienced, punctual and professional.


Views for this page
Today This Week This Month This Year  Overall
13739393 10,239

/SCOFAQ/FAQ_scotec7lpadmin.html copyright 1997-2003 (various) All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

More:
       - FAQ




Unix/Linux Consultants


http://www.schewanick.com SCO Unix, Solaris, Linx (various), PHP, MySQL, Apache, uniBasic, dL4, Perl, System Administration and more....


http://thatitguy.com Business networking servers, Linux and Unix experts. In business since 1997! Windows and Exchange to Samba and Scalix migration experts.


http://bcstechnology.net Full service Linux & UNIX systems integrator; Windows to UNIX/Linux Client-Server Specialist; Secure E-Mail & Website Hosting; Thoroughbred Software Developer; Custom Industrial Automation; Hardware & Electronics Experts; In Business Since 1985.



Twitter
o Still too hot to work. Though if we weren't so stubborn, we'd turn on the A/C. 6:20 PM Jun 9th 2008








Change Congress