2

Greetings,

I recently installed tomcat on my OS X 10.5 box and while I was playing around with the ~/profile I accidentally put in a bad alias and saved it. Long story short every time I open up the Terminal app it tries to launch the alias and hangs up and is unresponsive with keyboard commands.

I tried deleting my Home folder -> Library -> Preferences -> com.apple.terminal.plist

This did not work.... However when I create another user on the system the Terminal works fine.

It's prob some hidden file in the Home directory I assume? But I have had no such luck with rigging my Mac to view hidden files. Please help!

2
  • superuser.com or apple.stackexchange.com would be better places to ask this.
    – user135
    Commented Oct 27, 2010 at 18:11
  • If you have root enabled on the machine (From what I recall, OS X ships with root in some sort of disabled state, but you can enable it), you should be able to log in as that and fix your files. Commented Oct 27, 2010 at 18:14

4 Answers 4

2

pressing Shift-cmd-. should toggle showing hidden files in finder, without having to use the terminal. Do this, find your .profile file, open it with textedit and fix your mistake.

2
  • Ahh - this may only work in 10.6..
    – xdumaine
    Commented Oct 27, 2010 at 18:36
  • Only works in file dialogs, not the actual Finder windows. (But still probably the easiest way, all others are destructive or fail with FileVault)
    – Daniel Beck
    Commented Oct 27, 2010 at 18:42
1

Are you the only user? If so on a new users name (give them admin priveledges) do the following:

sudo rm /home/useryoumesseduptheterminalfor/.bash_profile

or if its just called '.profile':

sudo rm /home/useryoumesseduptheterminalfor/.profile

that will remove the file and you will again be able to use terminal without hangups.

0

You can display the hidden files in the terminal with the following command:

cd /Users/newuser  
ls -al

All the files which contains a "." in front of the filename, are hidden files..

If you have found the file you need you can view the content with the following command:

cat .hiddenfile OR less .hiddenfile

Then copy out the things you need for restoring the .profile file. I hope that's what you wanted..

0

How about doing:

$ sudo mv -i /Users/YourMainAccountName/.profile /Users/YourMainAccountName/busted_profile

from the new user you just created?

You must log in to answer this question.