Now and then, I end up installing a piece of software via Composer or that places some of its binaries in directories other than the usual places that macOS expects to find them.

That is, if you’re running an app from within Terminal or that an application with a GUI expects to be in a certain location on disk, then it’s likely going to expect it in one of five places:

  1. /usr/bin
  2. /bin
  3. /usr/sbin
  4. /sbin
  5. /usr/local/bin

But, as I said, over time we end up installing things using third-party tools, or we end up installing things that place binaries outside of one of these directories.

Case in point: What happens if you want to install WP-CLI globally? Or what if you want to use a version of MySQL that ships with MAMP?

In those cases, those binaries are not going to be included in any of the aforementioned directories. When that happens, you have to modify your profile. If you’ve never done that, it can be daunting. And it can get messy if you don’t do it methodically over time.

So here’s a primer on Bash for WordPress developers for what your bash_profile is and how to manage third-party software with it.

Continue reading