Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Terminal is stuck and will not function

Hi there guys,


A while ago I tried to install aircrack using macports and ever since then my terminal will not function.


When i open it it just displays this:


Last login: Sun Dec 30 15:16:10 on ttys000





[Process Completed]




I've tried deleting the com.apple.Terminal.plsit file



Any ideas?


Thanks

Chris

MacBook, Mac OS X (10.6.7)

Posted on Dec 30, 2012 7:19 AM

Reply
18 replies

Dec 30, 2012 7:56 AM in response to chriswillis10

Have you got access to another Terminal application (if not download the free iTerm2) ?


If so, check to see if you have files called


~/.bash_login

~/.bash_logout

~/.bash.rc

~/.profile


If so, delete them. Restart Terminal. If the problem remains, examine (but don't delete)


/etc/profile


and post the contents here.


Message was edited by: softwater /please note the first four file names have a dot before them after the slash/

Dec 30, 2012 8:35 AM in response to chriswillis10

Both of those things are normal.


You should do two things now.


First, go back to your normal user account and go to


 > System Preferences > Users & Groups


Click the tab marked 'Login Items'. If you see anything related to the software you recently installed, delete if from the list (to do so, you highlight the item in the list and hit the — minus button underneath the list; do not choose the 'hide' checkbox). If you're not sure about any of the items in the list, just remove everything entirely.


Restart the mac, log into your normal account again and see if Terminal works.


--------------------------------------

If no, do the second thing:


Log into the new 'test' account; open Terminal.


At the command prompt, type


bash


press 'return' then type


login


press 'return' then type


(your normal user name, that is the name of the account having the problem, not the test account)


press 'return' then type


(your normal password)


press 'return' then type


cd ~/; ls -alF


Look for those four files I talked about earlier. If they exist do


rm filename


press 'return' and repeat for any you find. Then type


cat /etc/profile > ~/Desktop/profile.txt


Press 'return'. Log out of Terminal and the account. Log back in to your normal account. Test to see if Terminal works.


If not, return to this page and post the contents of the file on your desktop called 'profile.txt'.

Dec 30, 2012 9:30 AM in response to chriswillis10

No need to delete bash history. But you do need to find your bash profile.


Go back to Terminal in the other account. Repeat the 'bash' and 'login' commands as before. Then type


cd /etc


press 'return' then type


ls -alF


Is there a file called 'profile' in the list?


If yes, type


vi /etc/profile


press 'return' then

-- --- -- -- -- -- - --


EDIT: Press 'esc' on the keyboard, then type


:q


Press 'return' then type

-- --- -- -- -- -- - --


cp /etc/profile ~/desktop/profile.txt


If no, report that back here.

Dec 30, 2012 11:33 AM in response to chriswillis10

Everything "Softwater" has been telling you is good.


Your /etc/profile looks good.


Back to an earlier question about 'bash' in the title, that is the default title information when running the 'bash' shell, which stands for Bourne Again Shell, which is a double joke, as the original shell was written by Steven Bourne, and 'bash' is a rewrite, so it was Born Again :-) The shell is the bit of code that reads the keyboard, executes the commands you enter, and directs the output back to the terminal. There are other shells, but 'bash' is the default for Mac OS X, and it is good shell.


The fact that you could create a new account and NOT have the problems says your problems are local to your home directory. Anything global would have affected the 'test' account, but they did not.


I'm betting you overlooked .profile, as it does not contain 'bash' in its name, and it is very common for 3rd party command line installation instructions to suggest adding something to .profile.


If you could, would you please use the Terminal -> Shell -> New Command to try removing .profile


rm .profile

rm .bash_profile

rm .bash_login

rm .bashrc


The other 3 are because I want to be sure. DO NOT include an ~ nor any wildcard characters such as *. Just enter what I have shown via individual Finder -> Shell -> New Commands (Command-Shift-N for short).


Then try starting a new Terminal session


If this does not work, please consider using Terminal -> Shell -> New Command to provide a listing of all the files in your home directory (you may edit the list for anything that does not include a dot at the first character, but if the file listed is not sensitive please consider leaving it in the list you post


/bin/ls -laeO@


You can triple click on the last line, then scroll back to the beginning of the list, and SHIFT-Click to select all of the lines. Then Command-C to copy it. Finally paste it into a text editor, such as TextEdit so you can clean it up (filter out stuff we should not see).


I am hoping that again trying to remove any shell related initialization scripts will clear this up and you will not need to tell us what is in your home directory.

Terminal is stuck and will not function

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