Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Benz63amg

macrumors 601
Original poster
Oct 17, 2010
4,113
805
hey guys, i know how to do it in snow leopard but now in lion i cant seem to be able to edit the hosts file, it says its in use when i try to replace it after i edited it. how do i do it in lion?
 

newfoundglory

macrumors 6502
Nov 5, 2007
281
8
the easiest way to ADD something to the hosts file, is to put your additions in another file (eg. put the lines to add in add.txt in your home directory). Then using Terminal type

Code:
$  sudo -s
[enter your password]
#  cat ~/add.txt >> /etc/hosts

Make sure you use two >> and not one > :)

Alternatively, use vi for editing.
 
Last edited:

IrishTiger

macrumors regular
Apr 23, 2010
229
19
Atlanta, GA
I'm going to resurrect this thread as it became useful.

I bought a MacBook Air over the weekend, and I did the migration assistant from my MacBook Pro - however I needed to fix some software issues, Lion wouldn't let me do it the old way I did, but Gas Mask, the free downloadable app worked like a charm!!!!! Everything is back to normal.

Here's the link:
GAS MASK
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.