linux-command-line-print-lpr
THE ANSWER! (FOR A DEFAULT RAW TEXT PRINT)
lpadmin -p lpt6 -E -v socket://192.168.1.26 -m textonly.ppd
//the above command puts the printer at the ip address on the queue named lpt6 //with an auto detected default generic driver...
lpadmin -p lpt5 -E -v socket://192.168.1.25:9100 -m textonly.ppd
//the above specifies the LPT1 (aka parallel port 1) of a print server... //9101 and on usually indicate the next ports on the device
lpstat -a //see all configured printers
lpstat -p -d -o
lpstat -p //status of all printers lpstat -d //default destination of printers
lpstat -P lpt6 lpq -P lpt6
lprm 253 //remove job 253 from the queue
cat thesis.txt > /dev/lp //TO PRINT, ROOT ONLY
lpr -P printername filename //MOST BASIC PRINTING, SHOULD ALWAYS WORK
$ lpr -#2 -sP printername filename //TO PRINT, NORMAL USERS
-s indicates to spool (symbolic link) -# indicates number of copies -P indicates printer name
TO ADD A PRINTER //PPD's are usually stored under the /usr/share/cups/model/ directory
/usr/sbin/lpadmin -p printerqueue -E -v device -m ppd
/usr/sbin/lpadmin -p LaserJet -E -v socket://11.22.33.44 -m laserjet.ppd
/usr/sbin/lpadmin -p DeskJet -E -v parallel:/dev/lp1 -m deskjet.ppd
lpadmin -d PRINTER_NAME -v parallel:/dev/lp0 -m laserjet.ppd
error: (bad/emtpy ppd file name) lpadmin -p lpt6 -E -v socket://192.168.1.26 -m laserjet.ppd.gz
cp laserjet.ppd.gz ~ cd ~ gunzip -d laserjet.ppd.gz lpadmin -p lpt6 -E -v socket://192.168.1.26 -m laserjet.ppd
//copy the items? cp *.ppd /usr/share/cups/model/
TO DELETE A PRINTER
/usr/sbin/lpadmin -x printer ENTER
e.g. lpadmin -x lpt6
MANAGING PRINTERS WITH CUPS
apt-get -y install cups
http://www.cups.org/doc-1.1/sam.html#MANAGING_PRINTERS
lpinfo -v
network socket network beh network socket://192.168.1.29 network socket://192.168.1.22 network socket://192.168.1.21 network socket://192.168.1.24 network socket://192.168.1.28 network socket://192.168.1.26 network socket://192.168.1.27 network http network ipp network lpd direct scsi network smb network socket://192.168.1.23
for the CUPS webadmin browse to http://localhost:631
http://192.168.1.59:631/admin //error: could not connect to server
nano /etc/cups/cupsd.conf
LogLevel debug //was info
modify to be "Allow" and comment out any "auth" - trial and error =(
/etc/init.d/cups reload /etc/init.d/cups restart
/sbin/service cups restart
NOT SURE IF THE FOLLOWING IS NECESSARY?
lpadmin -p queue -v device-URI \ -P PPD-file -E
lpadmin -p ps -v socket://192.168.1.0:9100/ -P \ /usr/share/cups/model/Postscript-level1.ppd.gz -E
E [13/Jul/2009:15:37:11 +0100] [cups-driverd] Bad PPD name "/root/laserjet.ppd.gz"! E [13/Jul/2009:15:37:11 +0100] copy_model: empty PPD file! E [13/Jul/2009:15:37:11 +0100] PID 12150 (/usr/lib/cups/daemon/cups-driverd) stopped with status 1! I [13/Jul/2009:15:37:11 +0100] Hint: Try setting the LogLevel to "debug" to find out more.