MacOS – How to fix the $PATH variable


I need to revert my $PATH back to the default.

The catch here is that I broke it so bad that the echo $PATH command returns: /usr/
that's it, which means I can't use any of the methods described in other answers basically because any command returns "unknown command".

I can't vi, I can't nano, I can't do squat over Terminal. All of that was working before I broke $PATH so I'm sure its all path related.

Best Answer

This depends how you changed your path.

  • If you changed it in your shell, just close the window and open a new shell.
  • If you changed it in a profile, change it there.

Your path should look something like this: