Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My Terminal does not show my username when I open a new window. Additionally, I can't execute any commands either. This is what is in my window:

...

Last login: Sat Oct  5 22:27:07 on ttys000
ls -1

[Process completed]

...

I cannot run pwd or cd or ls -1 etc:

Here are my startup settings:

Any suggestions?

share|improve this question
2  
Could you post your ~/.bash_profile please? Also ~/.profile if you have one (~/ means your user's home directory). Also check if it works if you open using a command (use /bin/bash) instead of "default login shell". –  terdon Oct 6 '13 at 1:34
    
Basically what terdon said. The bash profile is probably either corrupt or missing. You may want to reference this other article which has more specific commands: superuser.com/questions/374204/… –  Hefewe1zen Oct 6 '13 at 1:40
    
Do you remember what you did before this problem started? (@Hefewe1zen, note that a missing .bash_profile is not a problem. In fact, this file does not exist by default.) –  slhck Oct 6 '13 at 8:45
    
@terdon: how do I post my ~/.bash_profile and ~/.profile? I set things to /bin/bash instead of default login shell. No luck. Hefewe1zen: Looked at the article. When he says "start with "export PATH=/usr..." am I supposed to paste that into Terminal as a command? Tried that. No luck. slhck: I can't remember what I was doing. It was ages ago. Where do I find my .bash_profile? –  Jono.L Oct 6 '13 at 23:18
    
If the file exists, it will be in your user's home directory ($HOME). Just get to it finder and add its contents to your question. –  terdon Oct 6 '13 at 23:23
show 5 more comments

1 Answer

This kind of problem is usually due to a command being run in one of bash's initialization files that never finishes so a prompt is never shown.

In OSX, the likeliest culprit is $HOME/.bash_profile. The simplest solution is to rename it and open a new shell. If that works, you can go back and copy anything you need from the original file. If you do this carefully, you should be able to pin point the original problem.

In this particular case, the problem is this line in .bash_profile:

source .bash_profile

The result of this is that .bash_profile will read itself over and over again in an infinite loop. Deleting that line will fix the problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.