Undo Terminal command?

I've been using Leopard, so when it appeared that I'd always be locked out of Skype, owing to a decision at Microsoft, I followed the advice of the moderator of a Skype group and used a series of commands to change host instructions: Terminal --> sudo nano/private/etc/hosts, then entered my password, then 127.0.0.1/ ui.skype, then hit Control-O, Enter and Control-x. That allowed me to use Skype again, but other things have been very slow, and my Mac doesn't seem to be able to function as well as it did before. Then MS issued a fix for Leopard users, and I installed that.

I really wish that I hadn't made the changes in Terminal. I asked the group moderator how to undo what I had done, and he said to put # in front of everything but added that it would affect my whole computer. I tried to get an answer about where to put the #s and what it meant when he said that putting the marks in might affect "everything" on my computer, but there was no response. Can you help me and explain just what I need to do to go back to where I was? I don't know where to put the marks, what that will do, whether it will foul everything up worse. I really am afraid of meddling with Terminal more unless I can undo what I did without making more of a mess. I don't want to do anything more in Terminal than what is necessary to restore the status quo.

I also think I shall install Snow Leopard (which the person who sold me the computer gave to me). Will that make a difference?

Thank you so much for your help.

MacBook, Mac OS X (10.5.8)

Posted on Dec 12, 2014 7:20 PM

Reply
9 replies

Dec 13, 2014 9:26 AM in response to Niel

Thank you very much, Niel. This is very helpful. Could you just answer one more question, though: It seems to me that I entered more than one line, so which should I mark with #? Is it sudo nano/private/etc/hosts, 127.0.0.1/ ui.skype, any other? And if I delete the line, do I just mark it and hit X? Delete? Or just backspace? I'm sorry to be so ignorant, but it was trust and ignorance that got me into this, after all, and I don't want to have to bother you (or anyone else) with it again.

Best,


Jenny

Dec 13, 2014 9:44 AM in response to jennywren1420

"#" indicates a comment so anything after that on that line is ignored,

so put a # before each line you want ignored (or delete the line).


Do you use Time Machine? If so, you can restore the hosts file to before you made the change.

(Open Finder. enter: ⇧⌘G, enter: /etc, highlight hosts then enter Time Machine and restore to a time before you made the changes)

Dec 13, 2014 2:23 PM in response to jennywren1420

In case you do not know, the host file is:

This file is a simple text file that associates IP addresses with hostnames. In modern systems, the host table has been superseded by DNS, Domain Name Server.


So, the file could be used to translate apple.com into some number, like 17.178.96.59. Adding a typical entry should not have had an impact on performance. However, 127.0.0.1 is another name for for you machine. I do not see how it would matter though.

Here is what I have in 10.4.11:


mac $ cat /private/etc/hosts

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1    localhost
255.255.255.255    broadcasthost
::1             localhost

Dec 26, 2014 7:56 AM in response to Tony T1

Thank you very much, Tony. Yes, I use Time Machine, so if I can discover just when I made the changeover, I may be able to do as you suggest. And many thanks for giving the directions. That could be extremely helpful. I'm not sure how to restore what was on the computer before the changes, but I can look into that. I also can follow the first suggestion. I tried doing the bit with the "#" and didn't see a difference, but maybe I didn't do it right. No great harm, of course.


Sorry for the delay in answering your message (and that of Niel and rcharles. It's been a very crazy few weeks since I wrote my message.

Dec 26, 2014 10:41 AM in response to jennywren1420

jennywren1420 wrote:


Thank you very much, Tony. Yes, I use Time Machine, so if I can discover just when I made the changeover, I may be able to do as you suggest.


If you hit [spacebar] while hosts is highlighted, you can see the date of the last change.


To restore from Time Machine

Enter Time Machine

Enter: ⇧⌘G

Enter: /etc

Look for hosts, highlight, go to a time before the change and click [Restore]


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Undo Terminal command?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.