title: Difference between 'sed -i' and 'sed ... > file'
body: <p>I would like to know the difference between these two lines :</p>
  
  <pre><code>sudo sed 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=3/' /etc/default/grub &gt;/etc/default/grub
  </code></pre>
  
  <p>and</p>
  
  <pre><code>sudo sed -i 's/GRUB_TIMEOUT=10/GRUB_TIMEOUT=3/' /etc/default/grub
  </code></pre>
  
  <p>There seems to be a difference because the first returns a Permission denied error while the other doesn't.</p>