Printing FAQ

How do I set up a network printer or print server?

LPR/LPD printers

Of course Unix/Linux systems know how to print to these. SCO called them "Remote" printers, but LPD (RFC1179) is what they meant (though uncheck the "extended protocol" unless the printer is on another SCO box).

In the absence of a printer config tool, you can easily add lpd printers to /etc/printcap - there's lots of information here about that.

Even Windows can print to LPD, but you have to install "Other Network File and Print Services" from "Add/Remove Windows Components". Windows can also be an LPD server; you need "Print Services For Unix" to get that.

Direct socket printers

HP printers, Netgear print servers and others often use direct socket printing. To print, you simply send data to a specific network port: 9100 for HP, 9101 for the second printer on a HP multiport print server, 4010 for Netgear and so on. There's no protocol, headers, trailers - whatever you send, the printer gets.


With CUPS, you can do this right from the command line:

sudo lpadmin -p laserjet6L -E -v socket:// -m laserjet

In that case, we want to call our printer "laserjet6L" and it lives at on port 4010 (that's a Netgear Printserver).

You can do the same thing on OS X if it fails to find your printer by itself.

SCO (System V)

If your printer does LPD, you set it up as a Remote Printer.

If it does not, see the example of using "netcat" at How do I install a HP Network Printer or Print Server?. You'll need to know its IP address and /Jeffl/portnumbers.html.


Windows has a very strange setup for this. You'd logically think that you'd choose "Network Printer", but no, you need to choose "Local" and then create a new port, choosing TCP/IP as the port type. If this is a port 9100 printer (HP), that's "Generic"; otherwise you choose the port in the advanced configuration.


You can send data straight to any port printer:

use IO::Socket;
$host=shift @ARGV;
$port=shift @ARGV;
$socket=IO::Socket::INET->new(PeerAddr=> $host, PeerPort=> $port, Proto=> 'tcp',
Type=> SOCK_STREAM) or die "Can't talk to $host at $port";

while (<>) {
print $socket $_;
close $socket;


On Linux/Unix/OS X, you could also use "nc" for the same purpose. "cat yourfile | netcat printer_ip_address 9100", for example.

For old SCO, see Where do I get "netcat" and how do I use it?

Got something to add? Send me email.

(OLDER) <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> How do I set up a network printer or print server?


More Articles by

Find me on Google+

© Anthony Lawrence

Tue Sep 8 20:23:20 2009: 6875   TonyLawrence

I did a bit of updating on this today. I intend to go through all the old FAQ material and update it where appropriate. Please drop a comment if I made a mistake or missed anything.

Wed Jun 23 10:58:51 2010: 8736   antonius


I wonder if one could setup cups to act like a virtual spooler that way to generate ps files into a folder ?

Wed Jun 23 12:16:17 2010: 8737   TonyLawrence


Yes, you can. See (link) and be sure to read the comments too.

Kerio Samepage

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.

Contact us

privacy policy