Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I originally posted this at Stack Overflow but I thought it would be more appropriate here:

My LPT? printer (HP Deskjet 420) is indenting text when I print to it:

echo -e "this is text" > /dev/lp0
echo -e "moretext" > /dev/lp0
echo -e "also text" > /dev/lp0


this is text

How do I have each line be directly below the line before?

Using Lubuntu with bash.

share|improve this question
up vote 1 down vote accepted

To fix this problem, enable the newline (-n) flag when echoing text, and follow every command with


What this does is the command makes a newline manually then prints a carriage return, which literally returns the print carriage to the beginning of the new line. Example bash code:

echo -e -n "this is text\n\r" > /dev/lp0
echo -e -n "moretext\n\r" > /dev/lp0
echo -e -n "also text\n\r" > /dev/lp0

Should print:

this is text
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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