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.




M3IP inc.

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


Views for this page
Today This Week This Month This Year  Overall
41183874,579 9,553

/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

Your ad here - $48.00 yearly!

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.


http://www.m3ipinc.com Security, firewalls, ids, audits, vulnerability assesments, BS7799, HIPAA, GLB, incident handling


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



Twitter
  • Nov 21 07:55
    @loudmouthman: correct, but how do you prove ANYTHING like that is accurate? You can't. A text file is no better or worse than anything.
  • Nov 21 07:40
    @loudmouthman: well, a digital signature could prove it hadn't been altered. Text is no more insecure than anything else in that sense.









Change Congress


Related Posts