Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

export PATH=/Users/tom/sshfs-binaries:$PATH

share|improve this question
add comment

migrated from stackoverflow.com Nov 9 '11 at 8:28

This question came from our site for professional and enthusiast programmers.

2 Answers

There's also ~/.MacOSX/environment.plist (also this and this).

"Note: Any changes to ~/.MacOSX/environment.plist require that you logout and login again for the change to take effect."

share|improve this answer
add comment

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.

share|improve this answer
    
how would I make it applicable for just one user? –  c12 Nov 8 '11 at 19:19
    
@C12: put that export command on the /home/<user>/.bash_profile file. –  jweyrich Nov 8 '11 at 19:34
    
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? –  user13463 Nov 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 Salaz Nov 9 '11 at 23:37
    
Oh, my bad. Jason is correct. When I wrote that comment I forgot the question was about OS X. –  jweyrich Nov 10 '11 at 0:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.