How to add a directory to your PATH
I installed a new command-line tool the other day. The instructions said to add its directory to my PATH.
I remember this being confusing. You edit a file, but which one? And what do you add? If you get it wrong, you might even break some of your existing commands.
So let's look at how the PATH works and how to change it safely.