I'd like to install a binary for only my user, because I don't have root, and therefore don't have access to /usr/bin. I've tried ~/bin, and it can't find the binary. I'm on Mac OS 10.6.7. Is there any other binary folder that can usually be user-modified, or any way to get it to recognize ~/bin?

My .profile:

# Setting PATH for Python 2.7
# The orginal version is saved in .profile.pysave
export PATH

A user's BASH environment variables can be defined in ~/.profile. Add a line to this file:

export PATH=$PATH:~/bin

To read the new PATH variable now:

. ~/.profile


source ~/.profile

(The . and source are synonyms.)

Then to see that the PATH variable was updated:

echo $PATH


I have never seen {} in a PATH environment variable?

export $PATH

Or create a text file containing a path in /etc/paths.d/ so all shells and users get the path...

echo "~/bin/" > /etc/paths.d/home
  • So you can add ~/bin (or preferably ~/.bin) to the list of places that it looks for binaries in? – tkbx Jan 19 '13 at 17:26
  • 1
    @tkbx that is what he is doin here. I don't think ~/.bin is preferable, as ~/bin is fairly standard and even configured by default in some operating systems. – jordanm Jan 19 '13 at 17:48
  • @Christopher I've edited my answer to show my .profile. How can I modify this to add ~/bin without breaking whatever is already there? – tkbx Jan 22 '13 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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