Remote printing to a TCP/IP-enabled printer using lpr

A TCP/IP-enabled printer doesn't need an attached computer to provide print services; the printer itself provides the services.

So, you use the same basic steps described above, with the following minor alterations:

This example shows that the name of the remote machine (in this case, the actual printer) is tcpip_printer and the spool directory is /usr/spool/output/lpd/rlpt2. Note that the remote printer is specified as /ps, which is the name some network printers use for accepting PostScript files. You need to find out the name your printer wants you to use; it may require different names for different types of print file format (e.g., PostScript and text files).

Make sure you've created your spool directory—that's about it. Follow the usual steps described in "Local and remote printers," and you should be able to print to your remote printer using a command line like this:

lpr -Prlpt2 /root/

This sends a PostScript file named /root/ to the remote printer named tcpip_printer located at the IP address,

Note: To keep it simple, we've taken the easy way out in this example by sending a PostScript file to a PostScript printer. It's easy because the formatting is embedded in the PostScript text. You might have to filter the print file to get your printer to work using lpr; you can specify the filter to use in the /etc/printcap entry for the printer (for more information on this, see "Filters").