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 am faced with a problem, that I can't run even a single command on my Mac OS X Lion terminal, even "ls" command, when i print $PATH variable, found

My-Mac:/ Mac$ echo $PATH

Please help me if you have guys have any solution for that.

share|improve this question
up vote 2 down vote accepted

Start with export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin to get your commands back.

If you open up a new terminal, does it start with PATH as /usr/local/git/bin? If so, it sounds like your git installation screwed up your paths in /etc/paths, or your /etc/profile

Mine has (/etc/paths):


And /etc/profile should contain the following somewhere:

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`

Do these files contain similar lines on your system? If not, we'll need to see what they do contain and then properly merge them with what should be in there. If they check out, we'll look into your /etc/bashrc or local profile configurations.

share|improve this answer
got the solution, :) there is a .bash_profile file in my home dir, which executed when i open up the terminal , i deleted that file, its containing that git path only – Shahrukh Jan 3 '12 at 18:52
Awesome! Your git applications might not work now, so you might consider adding /usr/local/git/bin to the bottom of /etc/paths on it's own line if you haven't already. – Darth Android Jan 3 '12 at 18:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .