TIL: /usr/local/bin

This is the first in a series of shorter blog posts I am going to start writing semi-regularly called TIL, in which I go into the smaller programming or operational tricks I pick up in the course of my day. Posts will be limited to 200 words. This was inspired by Hashrocket’s Today I Learned blog.

The sub-title for this one is, “Patrick States the (fairly) Obvious.”

Untill today, whenever I needed to save a short script or executable, I would put it in a folder called bin and then add an alias to my zshrc.local file that would call that command. For example:

alias achive_tweets="~/bin/archive_tweets"

Well today I learned that I can just drop any old executable into usr/local/bin and it will be automagically added to my path!! This was incredibly exciting for me to realize. Now I can throw my scripts into ~/bin, where they are checked in to version control, and then create a symlink between that file in ~/bin and /usr/local/bin. This is incredibly empowering for me, and it gets rid of the messy list of aliases in `zshrc.local.