New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

Using Terminal


Post Reply New Thread Subscribe

 
Thread Tools
mreese88

 
Member Since: Jun 10, 2010
Posts: 43
mreese88 is on a distinguished road

mreese88 is offline
I am trying to delete a line of text that points to the wrong website.
I have been going back and forth with my hosting provider.

They have been giving me instructions, but I continue to have a problem getting to the file that contains the text I need to delete,

When I entered the command they gave me in Terminal it asked for my password. I don’t use a password. I find that to use the suto command a non- password is not acceptable so I added a password and logged in using it.
Now when I start Terminal I get a blank page and no matter what I enter nothing happens when I hit return.

The command I’m to use is $ sudo nano /private/etc/hosts in order to open the hosts file.

I know nothing about Terminal.

Any suggestions?

Thanks,

Mike
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,264
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
What exactly happens when you start Terminal? Do you get a prompt? What happens when you type 'ls' without the quotes (that's a lowercase L)?
Screenshot might be helpful.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
mreese88

 
Member Since: Jun 10, 2010
Posts: 43
mreese88 is on a distinguished road

mreese88 is offline
Blank Page.pngWhen I start Terminal I get a blank page with a cursor.

When I enter ls or any command I just get a return...the cursor moves to the next line.
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,264
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
OK, look in Terminal Preferences and make sure it starts up using the default, Bash like in the pic below.
Also make sure there are no files ending in .command in your user folder.
You might also try creating another user and logging in as that user and see if it still happens.
What version of OS X are you running?
Attached Images
File Type: jpg Screenshot_5_6_13_3_21_AM.jpg (139.0 KB, 24 views)

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
mreese88

 
Member Since: Jun 10, 2010
Posts: 43
mreese88 is on a distinguished road

mreese88 is offline
I changed my preferences to match what you sent and rebooted.

I now have a black screen, but I can make entries. I entered " /private/etc/hosts" and got a
permission message.
Attached Images
File Type: png Screen shot 2013-05-06 at 12.03.06 PM.png (30.5 KB, 22 views)
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,621
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
The file you are modifying is a regular text file and entering just its name means you are trying to execute it and that will fail.

You want to use "sudo nano /private/etc/hosts" from the instructions you've been given..

This will start a text editor with the file loaded in it, now delete the line and I think it's "ctrl+x" that is used to exit and it will prompt you to save the file, allow it to do so. I use VI normally..

--
Regards
...Ashwin



Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,264
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
OK, now we're cooking. That command '/private/etc/hosts' is telling bash to run the hosts file, which can't be done for a couple of reasons.
Try 'cd /private/etc/' which will change you to the etc directory where you can find the hosts file.
Why exactly are you needing to edit the hosts file anyway? If you don't know what you're doing you can screw things up royally.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
mreese88

 
Member Since: Jun 10, 2010
Posts: 43
mreese88 is on a distinguished road

mreese88 is offline
There is a line in the host file that keeps taking me to a page that the hosting company uses for parking a website that's not set up yet. The website I want has been setup and comes up correctly on other computers. On this one it always goes to the parked page.

Deleting the original line pointing to the parked webpage from the hosts file is what was given to me by the hosting company in order to correct the problem.

I sure want to be careful so I don't screw things up.

By the way, I'm running OS 10.6.8

Mike
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,264
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
Wondering why it's in the host file instead of just a link to the page? For that matter it's my understanding that redirects are done at the provider end and not on the client end.

Anyhow...be careful editing that file and only delete what they tell you to. Good luck.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
mreese88

 
Member Since: Jun 10, 2010
Posts: 43
mreese88 is on a distinguished road

mreese88 is offline
well 'cd /private/etc/' did not work, it said no such file.

Also "sudo nano /private/etc/hosts" gave me this page.
Attached Images
File Type: png Screen shot 2013-05-06 at 3.52.40 PM.png (12.0 KB, 20 views)
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
What makes you think somethings wrong with your hosts file to begin with?

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,264
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
My bad, it should be cd /etc
There is nothing there to redirect to any page. I think someone's jerking your chain. Unless there's more that we cant see?

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,621
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
Agree with Mike, your hosts file is fine. Unless you went in to previously ADD something in there, you wouldn't want to delete anything in there that's loaded by default..

If you are getting a landing page on your hosting site, you need to play with the configuration on the hosting side..not on your local machine..

One of the major reasons for messing with your hosts file is to run a local webserver and then point your domain name to localhost (127.0.0.1) so that you can play with the site locally and then disable it to go to the external site..

--
Regards
...Ashwin



Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks
mreese88

 
Member Since: Jun 10, 2010
Posts: 43
mreese88 is on a distinguished road

mreese88 is offline
Well now, none of this matters any more.

I tried to log on to the web site and what do know, it loaded the way it is supposed to.

By the way "cd /etc" did not work.

I appreciate all of your input.

Thanks,

Mike
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 18,105
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
Quote:
Originally Posted by mreese88 View Post
By the way "cd /etc" did not work.
That's not right - /etc is a valid directory and one that is present if you have a usable machine. cd /private/etc/ should work as well. You might have some weird issues going on here...

If you open up Finder, press Command-Shift-G, enter /etc and press enter, did you enter into a valid directory? What about /private/etc?

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks

Post Reply New Thread Subscribe


« Wifi Printer and Mountain Lion | grey screen on imac »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Automatically save log files of terminal sessions Stubaan OS X - Apps and Games 3 04-02-2013 11:24 AM
Terminal Won't Open icefall5 OS X - Operating System 7 08-25-2010 08:26 AM
C++ in terminal frike OS X - Development and Darwin 2 04-04-2008 10:52 AM
Terminal problems please help CliveO OS X - Operating System 6 03-20-2007 10:04 AM
Terminal Help rs2sensen OS X - Apps and Games 1 04-25-2005 10:52 PM

All times are GMT -4. The time now is 07:16 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?