Submitted by keith on Fri, 2007-04-13 15:12
Posted in

These are some useful UNIX printer commands which I have used along the years. Personally, I find that rather useful, especially if you are interested in configuring printers via text console.
Printing Options
- Two Sides:
lpr -o sides=two-sided-long-edge - Check Status:
lpstat -o -p - Cancel a Job:
cancel/lprm {job-id} - Set default options for CUPS:
lpoptions -o media=A4 -o sides=two-sided-long-edge - Adding a Printer:
lpadmin -p {printer-name} -E -v socket://{printer-ip-address} -m laserjet.pl - Removing a Printer:
lpadmin -x {printer-name} - Avoid using other CUPS Servers: (in the file /etc/cups/cupsd.conf, insert the following line)
Browsing off - Restarting CUPS Server
/etc/init.d/cups restart
Well, everything seems quite easy isn't it? The following deals with Windows client printer sharing. On the Linux (Samba server) system,
- Add a Samba user and password:
smbpasswd {user-name} - Configure Samba Printing Server: (in the file smb.conf, insert the following 2 lines)
printing=cups
printcap name=cups - Restarting a Samba Server:
smbd restart
Well, isn't that easy? Thanks to one of my colleagues for sharing this invaluable information.



Post new comment