Using Terminal

Joined
Jun 10, 2010
Messages
44
Reaction score
0
Points
6
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
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
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.
 
OP
M
Joined
Jun 10, 2010
Messages
44
Reaction score
0
Points
6
Blank Page.png When 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.
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
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?

Screenshot_5_6_13_3_21_AM.jpg
 
OP
M
Joined
Jun 10, 2010
Messages
44
Reaction score
0
Points
6
Terminal

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.

Screen shot 2013-05-06 at 12.03.06 PM.png
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
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..
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
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.
 
OP
M
Joined
Jun 10, 2010
Messages
44
Reaction score
0
Points
6
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
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
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.
 
OP
M
Joined
Jun 10, 2010
Messages
44
Reaction score
0
Points
6
well 'cd /private/etc/' did not work, it said no such file.

Also "sudo nano /private/etc/hosts" gave me this page.

Screen shot 2013-05-06 at 3.52.40 PM.png
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
What makes you think somethings wrong with your hosts file to begin with?
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
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?
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,762
Reaction score
2,100
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
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..
 
OP
M
Joined
Jun 10, 2010
Messages
44
Reaction score
0
Points
6
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
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
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?
 
OP
M
Joined
Jun 10, 2010
Messages
44
Reaction score
0
Points
6
Command-Shift-G does work and gets me to the etc file and that has "hosts" and a whole bunch of other files.

Since everything is working and the fact that I'm not knowledgeable about Terminal, I think it best to leave well enough alone.

Thanks again for all your input.

Mike
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Since everything is working and the fact that I'm not knowledgeable about Terminal, I think it best to leave well enough alone.
A very wise choice. A quick search on the web will make it quite clear how destructive the command line can be if used by those who don't know much about it.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top