The standard way of figuring out if something is installed is to use which
.
If Brew is installed.
>>> which brew
/usr/local/bin/brew
If Brew is not installed.
>>> which brew
brew not found
Note: The "not installed" message depends on your shell.
zsh
is shown above.bash
will just not print anything.csh
will saybrew: Command not found.
In the "installed" case, all shells will print the path.)
It works with all command line programs. Try which grep
or which python
. Since it tells you the program that you're running, it's helpful when debugging as well.