How to open and edit the file in the command line? I tried to use the command open
:
sudo open -e /etc/apache2/extra/httpd-vhosts.conf
but the file is Locked
and I can not change anything.
I need to edit a lot of text and use nano
or vim
is not very convenient.
I suspect this is because the permission elevation is for the open
command, not TextEdit itself.
You should use a different editor that can have its binary run properly from the command line like SublimeText (sudo subl /path/to/file
) or TextMate (sudo mate /path/to/file
). Or just suck it up and use vi
or nano
:-)
If you're going to be doing a lot of this type of thing TextEdit is probably the least desirable editor to use anyhow.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments