Can't Edit the Hosts directory

Discussion in 'macOS' started by FlameArchon, Jan 26, 2012.

  1. FlameArchon macrumors newbie

    Jan 26, 2012
    So, I want to make some changes in the hosts directory. So, as root, I type this in:

    sudo /Applications/ /etc/hosts

    However, I get this response;

    2012-01-26 19:37:49.146 TextEdit [233:8e13] NSTrackPersistentURLs:LSSharedFileLiseInsertItemURL ( ) failed at inserting URL file://localhost/etc/hosts (etc/hosts)

    Even though TextEdit still opens with exactly what I'm looking for. However, even logged in as root it won't let me make any changes. Any ideas?
  2. maflynn Moderator


    Staff Member

    May 3, 2009
    try editing it with pico (using sudo)

    I think you might need start an OSX app using open, that is sudo open /Applications/ /etc/hosts

Share This Page