User's bin directory OS X way
You may want to have you custom executable scripts. Usually they goes to the ~/bin
, but personally I don't like a lot of folders in my home directory, at least visible folders. Here is how I do it.
In OS X you can make any folder hidden. I assume you already have ~/bin
. Now we will make it hidden by running the following command in Terminal
chflags hidden ~/bin
Now you should modify you ~/.profile
file. Add the following lines at top of it.
# Include user's bin folder.
if [ -d "$HOME/bin" ] ; then
export PATH="$HOME/bin:$PATH"
fi
and save it. Now execute
source ~/.profile
to apply these changes. That's it. You can create any script inside this folder. Make sure these files have executable flag. To make it executable run the following command:
chmod +x ~/bin/your_script.sh
Happy coding!
Written by Vladimir Prudnikov
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Os x
Authors
mikker
63.06K
themichael'tips
28.98K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#