How to trim URL to root domain?

No, this won't work. But you don't need the first one, since probably you don't have a bin directory in your Home folder.

The important part, if you are using Homebrew, is the /usr/local/bin. It should be before the /usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin or whatever you have there.

Separate the paths with a :