Ubuntu – How to print directly to LPT port in Ubuntu

parallel portprinterUbuntuubuntu-10.04

While screwing around my garage, I've found an ancient matrix printer, Epson LX-1050. Ubuntu recognised it without problems, and I was able to print several pages using it via CUPS.

Now, for some reason, I want to use this printer the way it was designed back in 1994: to write directly to parallel port. I've tried the most simplistic approach that works to operate my USB 3G modem:

echo "Y helo thar" > /dev/lp0

I've got an error:

bash: /dev/lp0: Access denied

I've tried sudo'ing this command with no success. Also tried to mirror the DOS approach of copying file to LPT1:

cp /etc/hosts /dev/lp0

Again with no success.

Any suggestions that I can try to get this approach to work?

Best Answer

I seem to have it figured out. Silly me. While googling examples of lpadmin usage, I've stubled upon this link: http://ubuntuforums.org/showthread.php?t=1437325

Permissions on dev/lp0 were:

c---rw---- 1 root lp 6, 0 2011-06-26 22:47 /dev/lp0

Group lp, from my knowledge, has only the lp user. After I performed

sudo chmod 666 /dev/lp0

the following command started working as intended, making printer to output symbols to paper:

echo "Y helo thar" > /dev/lp0

Well, I suppose that is a nice foolproof against someone accidentally writing to LPT port aside from printing daemon, but still it makes no sense for me, why is it disabled for root?

Related Question