title: How do I erase printed characters in a console application(Linux)?
body: <p>I am creating a small console app that needs a progress bar. Something like...</p>
  
  <pre><code>Conversion: 175/348 Seconds   |==========          |  50%
  </code></pre>
  
  <p>My question is, how do you erase characters already printed to the console? When I reach the 51st percentage, I have to erase this line from the console and insert a new line. In my current solution, this is what happens...</p>
  
  <pre><code>Conversion: 175/348 Seconds   |==========          |  50%
  Conversion: 179/348 Seconds   |==========          |  52%
  Conversion: 183/348 Seconds   |==========          |  54%
  Conversion: 187/348 Seconds   |===========         |  56%
  </code></pre>
  
  <p>Code I use is...</p>
  
  <pre><code>print "Conversion: $converted_seconds/$total_time Seconds   $progress_bar  $converted_percentage%\n";
  </code></pre>
  
  <p>I am doing this in Linux using PHP(only I will use the app - so please excuse the language choice). So, the solution should work on the Linux platform - but if you have a solution that's cross platform, that would be preferable.</p>