Take the 2-minute tour ×

In windows you can use LPR

In Linux you can do lpr or 'data.txt > /dev/lpt1/'

How do I do it on a Mac?

share|improve this question
I assume this is OS X? Not OS 9 or, god forbid, OS 8? –  Mark Henderson Aug 25 '09 at 1:43
I should have clarified that. OSX is the OS in question. :) –  sanbornm Aug 25 '09 at 1:55
add comment

2 Answers

up vote 4 down vote accepted

lpr works great on the Mac.

If you type "lpr foo.txt" on my MacBook Pro, it gets sent to my default printer. Make sure that you have a printer setup.

Update: I asked a few of the Mac guys in the office about this and they indicated that in the past, some low-end "Win-Printers" with Mac drivers were unable to actually process plain text coming from LPR. We've since removed all of these printers from our inventory, so I'm unable to verify.

share|improve this answer
This is an excellent and easy solution. We use lpr and html2ps on our web servers to print out web orders and it works like a charm. –  morgant Aug 25 '09 at 16:59
add comment

Another handy option is to use netcat to send a raw postscript file directly to a networked printer. This is occasionally useful in wierd circumstances, like if you don't have or don't want to install printer drivers. I find it particularly useful on Linux boxes since you never know quite how they are set up.

Most Mac and Linux apps will print to a postcript file, and then you can run:

nc 9100 < file.ps

to send the postscript file directly to a printer on the network. (Replace the 255s with the actual printer IP address.)

Not something you'll use every day, but if you do a lot of consulting/troubleshooting on the road with your laptop it may come in handy.

share|improve this answer
add comment

Your Answer


