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?

link|improve this question
1  
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
feedback

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.

link|improve this answer
1  
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
feedback

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 255.255.255.255 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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.