1

This line used to work sudo -b "/Applications/Textedit.app/Contents/MacOS/TextEdit" /etc/hosts

But on Yosemite, it does not work anymore.

  • This should work: "open -a TextEdit /etc/hosts" – At0mic Sep 16 '15 at 16:37
  • What exactly "doesn't work"' any longer? Any error messages? – nohillside Sep 16 '15 at 16:41
  • @IronCraftMan it does not work: when trying to save I have a error message : "You do not have the permissions... to edit hosts" – Colas Sep 16 '15 at 19:51
  • @patrix Nothing happens! – Colas Sep 16 '15 at 19:51
1

Yes I just tried your command and it exists with error code 132 (I don't know why).

You can still use this to open your hosts file sudo open -t /etc/hosts. It will open the TextEdit app, if you want to run it in the background you can add your -b in the command line. Or you can use other text editors like vim and nano they're both working perfectly with Yosemite.

  • When trying to save I have a error message : "You do not have the permissions... to edit hosts" – Colas Sep 16 '15 at 19:53
  • 1
    you need to duplicate the file before editing it with TextEdit and then copy it back – enzo Sep 17 '15 at 8:26
  • I think on OS 10.9, it used to work without copying the file. I was looking forward to the same behavior. – Colas Sep 17 '15 at 16:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .