Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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 ->

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!

share|improve this question

migrated from Oct 27 '10 at 18:19

This question came from our site for professional and enthusiast programmers. or would be better places to ask this. – user135 Oct 27 '10 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. – FrustratedWithFormsDesigner Oct 27 '10 at 18:14

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.

share|improve this answer
Ahh - this may only work in 10.6.. – xdumaine Oct 27 '10 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 Oct 27 '10 at 18:42

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.

share|improve this answer

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..

share|improve this answer

How about doing:

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

from the new user you just created?

share|improve this answer

You must log in to answer this question.