title: Delete a line using SED from a file and redirect the output to same file
body: <p>I use sed command to delete first two lines and last  line from a file and i want to redirect the output to the SAME file </p>
  
  <p>EXAMPLE : </p>
  
  <pre><code>sed '1,2d' '$d' pra &gt;pra
  </code></pre>
  
  <p>this deletes first two lines &amp; last line  from the file .But when i try to redirect the output to Same file , an Problem Occurs .</p>
  
  <p>when i open and see the the redirected file <code>pra</code> nothing is present inside the file .</p>
  
  <p>IS there a better way of doing this ..deleting first two lines and last line from a file and and saving it with the same file Name . </p>