Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Using Terminal

  1. #1
    Using Terminal

    Member Since
    Jun 10, 2010
    Posts
    44
    Using Terminal
    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

  2. #2
    Using Terminal
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,082
    Specs:
    13in macbook - 10.10.4
    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
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  3. #3
    Using Terminal

    Member Since
    Jun 10, 2010
    Posts
    44
    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.

  4. #4
    Using Terminal
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,082
    Specs:
    13in macbook - 10.10.4
    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 Attached Images
    Craig Domingue
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  5. #5
    Using Terminal

    Member Since
    Jun 10, 2010
    Posts
    44
    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.
    Attached Images Attached Images

  6. #6
    Using Terminal
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,189
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3
    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.

  7. #7
    Using Terminal
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,082
    Specs:
    13in macbook - 10.10.4
    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
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  8. #8
    Using Terminal

    Member Since
    Jun 10, 2010
    Posts
    44
    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

  9. #9
    Using Terminal
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,082
    Specs:
    13in macbook - 10.10.4
    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
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  10. #10
    Using Terminal

    Member Since
    Jun 10, 2010
    Posts
    44
    well 'cd /private/etc/' did not work, it said no such file.

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

  11. #11
    Using Terminal
    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,821
    Specs:
    Way... way too many specs to list.
    What makes you think somethings wrong with your hosts file to begin with?
    mike
    This machine kills fascists
    Got # ? phear the command line!

  12. #12
    Using Terminal
    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Nederland, Texas
    Posts
    4,082
    Specs:
    13in macbook - 10.10.4
    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
    (\__/)
    (='.'=) This is Bunny. Copy and paste Bunny into your
    (")_(") signature to help him gain world domination

  13. #13
    Using Terminal
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    8,189
    Specs:
    27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3
    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.

  14. #14
    Using Terminal

    Member Since
    Jun 10, 2010
    Posts
    44
    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

  15. #15
    Using Terminal
    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,398
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Month in Terminal is in Russian - only in Terminal!
    By yoandrew in forum OS X - Operating System
    Replies: 4
    Last Post: 12-29-2012, 09:20 AM
  2. Terminal Help?
    By gts1117 in forum OS X - Operating System
    Replies: 2
    Last Post: 08-20-2012, 09:25 AM
  3. Terminal Help
    By LMCLUMD in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 06-15-2011, 04:08 AM
  4. help!! terminal os 10.5.8
    By alcohol in forum OS X - Operating System
    Replies: 10
    Last Post: 04-10-2011, 12:35 PM
  5. using terminal
    By mayflyTR in forum OS X - Operating System
    Replies: 3
    Last Post: 08-22-2010, 05:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •