What is the best way to permanently change the Mac OS X path variable? I've tried to add a .profile file in my user home directory with the below path, but that didn't work. Right now I have to run the export command every time I open up a new instance of the console. Any ideas?

2 Answers
2

If that's for a single user, you can add export PATH=/new/path:${PATH} to ~/.bash_profile. If it's going to be really global (for all users), then add it to /etc/profile and make sure the users have permission to access the path you're including. After that, you need to re-launch the shell, or reload the configurations with source /etc/profile or source ~/.bash_profile.

I'm not the admin of this machine and I don't have a user directory in the /home/ dir. I also don't have a .bash_profile file under /Users/username. Any ideas?
–
user13463Nov 9 '11 at 18:24

I suspect this happened before the question was migrated, but /home/<user>/.bash_profile is incorrect. On OS X it's /Users/<username>/.bash_profile So for example: /Users/c12/.bash_profile, just create the file if it doesn't exist and changes will be automatically picked up at next login / terminal invocation.
–
Jason SalazNov 9 '11 at 23:37

Oh, my bad. Jason is correct. When I wrote that comment I forgot the question was about OS X.
–
jweyrichNov 10 '11 at 0:47