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:
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