osx - Unable to make file editable on Mac OS X -


i'm trying edit httpd.conf file located in /private/etc/apache2, , can't figure out how permission write

i've done

$ cd /private/etc/apache2 $ sudo chown bdh httpd.conf $ ls -lash  0 drwxr-xr-x  13 root      wheel   442b jun  7 00:11 .  0 drwxr-xr-x  93 root      wheel   3.1k jun 26 10:51 ..  0 drwxr-xr-x  13 root      wheel   442b jan  3 16:26 24 -r--r--r--   1 bdh       wheel    24k jun  7 00:11 httpd.conf  ...etc... $ vim httpd.conf 

and says "httpd.conf" [readonly] 677l, 24330c

tried cping desktop, cant permission edit there either

i'm pretty new using terminal, there other command can use?

it unnecessary , undesirable alter access permissions edit file. edit file requires administrator (or other user) privileges without altering access permissions, use:

sudo -e /private/etc/apache2 

sudo's -e option tells want edit given file.

this command copies file , makes writable you, tells editor specified sudo_editor, visual or editor environment variables (they're checked in order) edit file, , when editor exits, file copied original without altering access permissions.

see sudo man page details: x-man-page://8/sudo


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -