Mac OS X: Edit hosts file in terminal

Posted: November 10, 2014 in Apple
Tags:

If you are familiar with unix command line, editing hosts file in OS X can be very easy. Just sudo your favourite editor and save it.

sudo vi /private/etc/hosts

But if your user password is empty, according to Apple, you are not allowed to use sudo command in command line. http://support.apple.com/en-sg/HT4103

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s