Tell me more ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I was trying to add something to $PATH and it went totally wrong. I now can't run any commands such as ls. I've looked at this answer and used the following lines:

PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
PATH=$PATH:~/bin

These lines fix the problem temorarily; however, when I restart terminal it seems to forget these changes.

How do I permanently reset my $PATH?

I'm running the most recent version of Mountain Lion.

share|improve this question
4  
Fixed it: /bin/rm ~/.bash_profile – Nosrettap Jan 18 at 22:03
2  
Good question. You could always put your fix in an answer. – bassplayer7 Jan 18 at 22:43
Also asked on superuser – glenn jackman Jan 19 at 1:00
1  
Realizing you already fixed your problem, users with a similar issue might also find help at /etc/paths – BigDave Jan 21 at 12:37

1 Answer

Remove the your bash profile to restore the default $PATH. Enter the following command into Terminal.app:

/bin/rm ~/.bash_profile

The change will take place with the next shell or terminal session.

share|improve this answer
Answering, based on original questioner's comments, to remove the question from the unanswered queue. – Graham Miln Jan 25 at 12:41
2  
Well, if you want to keep other content of your profile, a simple /bin/mv ~/.bash_profile ~/bash_profile might be better – patrix Jan 25 at 17:40

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.