title: Java - Rewriting Multiple Lines in the Console
body: <p>I am running Windows, however the program I am writing needs to be cross compatible with Linux.</p>
  
  <p>I am aware that you can rewrite (or replace a already written line in the console with another) single lines in the console in both Windows/Linux just by using \r</p>
  
  <pre><code>System.out.print("Initial line");
  System.out.print("\r");
  System.out.print("Updated line");
  </code></pre>
  
  <p>but I would like to rewrite multiple lines like:</p>
  
  <pre><code>System.out.print("Line 1");
  System.out.print("Line 2");
  // magic code
  System.out.print("Updated line 1");
  System.out.print("Updated line 2");
  </code></pre>
  
  <p>I would guess that you use something along the lines of \b, etc but I am at a loss. Anyone know how this is done? <strong>(NO 3RD PARTY LIBRARIES)</strong></p>