Search code examples
command-lineterminalsudohosts-file

Sudo etc/hosts file not working


I want to edit my etc/hosts file. In terminal/command line on a mac i have typed in sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit

Sometimes it asks for my password, I enter my password and nothing happened. Other times it doesn't even ask for a password and nothing happens. Why isn't this command working?


Solution

  • Try typing this instead.

    sudo nano /etc/hosts