Update $PATH variable on Mac Permanently

If you’re a developer or you commonly run apps from directory locations other than the default Mac locations, you probably hate typing out the full directory when running the app or script.

To update the $PATH variable within the Terminal you just need to type:

export PATH=/new/path:$PATH

To update the $PATH variable PERMANENTLY you just need to edit the .bash_profile file in your home directory (~). Just add the path variable changes to the file:


Now, every time you want to run your app/script, just type the script name! 🙂

[UPDATED] (Thanks Mike)
If you want to make the change permanent for all users, you can make the change in /etc/profile

Leave a Reply

Responses to “Update $PATH variable on Mac Permanently”

  1. Mike Mackintosh (@mikemackintosh) April 1st, 2013 - 5:38 pm

    To make it permanent for all users you could update `/etc/profile` as well.