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.

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
add comment

1 Answer

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
4  
You don't need to hardcode your username: PATH=$PATH:~/bin –  glenn jackman May 29 '13 at 16:19
2  
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. –  πterPan 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
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.