title: How to empty ("truncate") a file on linux that already exists and is protected in someway?
body: <p>I have a file called error.log on my server that I need to frequently truncate. I have rw permissions for the file. Opening the file in vi > deleting all content > saving works (obviously). But when I try the below </p>
  
  <pre><code>cat /dev/null &gt; error.log
  </code></pre>
  
  <p>I get the message</p>
  
  <pre><code>File already exists.
  </code></pre>
  
  <p>Obviously there is some kind of configuration done on the server to prevent accidental overriding of files. Can anybody tell how do I "truncate" the file in a single command?</p>