title: How can I remove all but the last 10 lines from a file?
body: <p>Is it possible to keep only the last 10 lines of a lines with a simple shell command?</p>
  
  <pre><code>tail -n 10 test.log
  </code></pre>
  
  <p>delivers the right result, but I don't know how to modify test.log itself. And</p>
  
  <pre><code>tail -n 10 test.log &gt; test.log
  </code></pre>
  
  <p>doesn't work.</p>