Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
You should be able to write to that. Strange! – sinni800 Jun 24 '11 at 17:43
up vote 5 down vote accepted

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?

share|improve this answer

Probably the lp daemon (print spooler) has exclusive ownership of /dev/lp. Shutdown the spooler (read up on lpadmin and /usr/bin/disable).

share|improve this answer
    
While your idea is not entirely correct, it made me go and read up on how the printing in Linux works. Thanks. – xyzman Jun 26 '11 at 19:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .