Can't edit host file

Discussion in 'Mac OS X Lion (10.7)' started by Jarl, Aug 13, 2011.

  1. Jarl macrumors newbie

    Joined:
    Aug 13, 2011
    #1
    Hi,

    I'm using OS X Lion 10.7 and I want to edit my host file using the following terminal command:

    "sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts"

    I'm logged in as administrator and I enabled the root user.
    Still after entering my password I get this error message:

    "TextEdit[603:7907] PersistentUI: LSSharedFileListInsertItemURL() failed at inserting URL file://localhost/etc/hosts"

    What am I doing wrong?
     
  2. dijonemon macrumors newbie

    Joined:
    Jul 28, 2011
    #2
    Try just running

    sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit

    Then open the file by using File -> Open.
     
  3. macmongral macrumors member

    Joined:
    Jun 18, 2011
    #3
    try buying CS5 then you won't need to edit the file :D
     
  4. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
  5. Janneman59 macrumors newbie

    Janneman59

    Joined:
    Sep 18, 2009
  6. Jarl thread starter macrumors newbie

    Joined:
    Aug 13, 2011
  7. DandsM macrumors member

    Joined:
    Jan 31, 2011
    #7
    If you know that, I can assume you're also using/used a pirate copy. :rolleyes::cool:
     
  8. KlytusLord macrumors regular

    Joined:
    Apr 11, 2011
    #8
    Plenty or legitimate reasons to edit your hosts file; it's the easiest way to block known web advertisers, and it can solve some networking problems with multiple OSes, where name resolution does not always work as intended.
     
  9. buxus macrumors newbie

    Joined:
    Apr 25, 2012
    #9
    and how can I save the file? CMD+S doesn't work
    or which location do i need to select?

    thanks in advance
     

Share This Page