printing via serial to usb cable

Nils Kassube kassube at gmx.net
Thu Jan 29 06:50:04 UTC 2009


Wade Smart wrote:
> And I can print as I said a few posts back:
> wadesmart at wadesmart:~$ sudo echo "Printer Test" > /dev/ttyUSB0

I don't think you need sudo here if it works because the output 
file /dev/ttyUSB0 is opened by the user and not by root. Originally the 
group of /dev/ttyUSB0 is dialout and you are in that group as well. Only 
if you have changed the ownership to root:lp you would need sudo but then 
you would have to use something like this:

sudo su lp -c 'echo "Printer Test" > /dev/ttyUSB0'

> That will sent a job to the printer but you have to manually press GO
> on the printer to get it to print. However, that is not very efficient.

You could send a page feed to the printer with

echo -en "\f" > /dev/ttyUSB0


Nils




More information about the ubuntu-users mailing list