title: How to edit a file from the command line Mac OS X?
body: <p>How to open and edit the file in the command line? I tried to use the command <code>open</code>:</p>
  
  <pre><code>sudo open -e /etc/apache2/extra/httpd-vhosts.conf
  </code></pre>
  
  <p>but the file is <code>Locked</code> and I can not change anything. </p>
  
  <p><img src="https://i.stack.imgur.com/i86ds.png" alt="enter image description here"></p>
  
  <p>I need to edit a lot of text and use <code>nano</code> or <code>vim</code> is not very convenient.</p>