title: How to delete multiple empty lines with SED?
body: <p>I'm trying to compress a text document by deleting of duplicated empty lines, with <a href="http://en.wikipedia.org/wiki/Sed" rel="nofollow"><code>sed</code></a>. This is what I'm doing (to no avail):</p>
  
  <pre><code>sed -i -E 's/\n{3,}/\n/g' file.txt
  </code></pre>
  
  <p>I understand that it's not correct, according to <a href="http://www.grymoire.com/Unix/Sed.html#uh-47" rel="nofollow">this manual</a>, but I can't figure out how to do it correctly. Thanks.</p>