Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using Ubuntu I can save shell scripts in ~/bin. To launch them I just type the name of the script in the Terminal. Is there an equivalent solution for OSX?

share|improve this question
up vote 8 down vote accepted

There is none by default in OSX. But you can make a ~/bin folder, then edit your ~/.profile and add

export PATH=$PATH:/Users/Yourname/bin

(Yourname of course being replaced by your username).

or (edited later according to below comment)

export PATH=$PATH:~/bin
share|improve this answer
You don't need to hardcode your username: PATH=$PATH:~/bin – glenn jackman May 29 '13 at 16:19
In addition you can hide that folder in the finder by using the SetFile command. SetFile -a V ~/bin. I do that as a personal preference. – ismail May 29 '13 at 16:40
Thank you, it's working perfectly. – pomodorochris May 29 '13 at 16:42
Glad to hear :-) – Grezgory May 31 '13 at 11:54
FYI, to create the '.bin' folder, use the "make directory" command: mkdir bin To list it: ls -a If you make a mistake, delete the folder by using "remove directory" command: rmdir – Basil Bourque Dec 27 '13 at 4:16

Your Answer


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.