0

I accidentally messed up my $PATH. I Tried to follow the instructions from the previous similar questions but I keep having the same problem When I type: echo$ PATH, I get the following response: /Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin . Do you know how i can reset the PATH? The operating system is OS X El Capitan. Thank you so much

1 Answers1

1

First, run PATH=/bin:/usr/bin in Terminal.

Then open ~/.bash_profile (in terminal, nano/vim/favorite editor ~/.bash_profile) or open Finder, then press Shift+Command+G and paste it in. Then you can comment out the path line. There is no need to delete .bash_profile in its entirety, and it isn't recommended.

nohillside
  • 100,768
Bora
  • 1,266
  • I typed: PATH=/usr/bin:/bin:/usr/sbin:/sbin . When i open the .bash profile i do see the same path: PATH=/usr/bin:/bin:/usr/sbin:/sbin . however when i close and reopen the terminal and type: echo $PATH , the same old PATH appears. Dont know whats wrong. Tried to troubleshoot it but have the same problem. Thank you so much for your response – user190161 Jun 29 '16 at 16:18
  • This might be simple but did you save? – Bora Jun 29 '16 at 16:19
  • I haven't faced this problem recently. Maybe restart? Try again? Use a diff editor? The standard 9 yards... – Bora Jun 29 '16 at 16:20
  • I tried it before but it did not work. – user190161 Jun 29 '16 at 16:25
  • Tried login-logout or accepting the answer? – Bora Jun 29 '16 at 16:27
  • I did try to login-log out but it did not work – user190161 Jun 29 '16 at 16:30
  • Try source ~/.bash_profile in terminal – Bora Jun 29 '16 at 16:30
  • -sh: /Users/myusername/.bash_profile: No such file or directory – user190161 Jun 29 '16 at 16:31
  • Type source in the terminal then drag the actual file from the finder – Bora Jun 29 '16 at 16:32
  • -sh: source: filename argument required source: usage: source filename [arguments] – user190161 Jun 29 '16 at 16:40
  • did not work for some reason – user190161 Jun 29 '16 at 16:41
  • Try to restart? I don't know at this point... My suggestions above usually fixed the problem. – Bora Jun 29 '16 at 16:53
  • echo $PATH #figured out that it directs me to the .profile instead of the .bash_profile. Can this be the problem? Also if I open the .profile with a text edit, its written that The original version is saved in .profile.pysave. Can i retrieve the original version? – user190161 Jun 29 '16 at 17:45
  • I don't know. Can you access the .profile.pysave you were mentioning? – Bora Jun 29 '16 at 17:49
  • FIXED it! Thank you much for your advises! Actually the PATH name never changed. It was the .profile name instead of the .bash profile which remained the same! thank you much – user190161 Jun 29 '16 at 19:18