title: Running sed on a large (30G) one-line file returns an empty output
body: <p>I'm trying to perform simple literal search/replace on a large (30G) <strong>one-line</strong> file, using <code>sed</code>.</p>
  
  <p>I would expect this to take some time but, when I run it, it returns after a few seconds and, when I look at the generated file, it's zero length.</p>
  
  <ul>
  <li><p>input file has 30G</p>
  
  <pre><code>$ ls -lha Full-Text-Tokenized-Single-Line.txt  
  -rw-rw-r-- 1 ubuntu ubuntu 30G Jun  9 19:51 Full-Text-Tokenized-Single-Line.txt
  </code></pre></li>
  <li><p>run the command:</p>
  
  <pre><code>$ sed 's/&lt;unk&gt;/ /g' Full-Text-Tokenized-Single-Line.txt &gt; Full-Text-Tokenized-Single-Line-No-unks.txt
  </code></pre></li>
  <li><p>the output file has zero length!</p>
  
  <pre><code>$ ls -lha Full-Text-Tokenized-Single-Line-No-unks.txt 
  -rw-rw-r-- 1 ubuntu ubuntu 0 Jun  9 19:52 Full-Text-Tokenized-Single-Line-No-unks.txt
  </code></pre></li>
  </ul>
  
  <p><strong>Things I've tried</strong></p>
  
  <ul>
  <li>running the very same example on a shorter file: <strong>works</strong></li>
  <li>using -e modifier: <strong>doesn't work</strong></li>
  <li>escaping "&lt;" and ">": <strong>doesn't work</strong></li>
  <li>using a simple pattern line (<code>'s/foo/bar/g'</code>) instead: <strong>doesn't work</strong>: zero-length file is returned.</li>
  </ul>
  
  <h2>EDIT (more information)</h2>
  
  <ul>
  <li><p>return code is <strong>0</strong></p></li>
  <li><p>sed version is <strong>(GNU sed) 4.2.2</strong></p></li>
  </ul>