This confirms that brew is installed and accessible in your terminal's PATH.
If Homebrew is NOT installed or not in your PATH: You will see an error message like:
code
zsh: command not found: brew
(The exact message might vary slightly depending on your shell, e.g., bash: command not found: brew)
This means Homebrew is not installed on your system, or there's an issue with your shell's configuration preventing it from finding the brew command.
Method 2: Just type brew
Typing brew by itself will usually print a help message if it's installed.
Open your macOS Terminal application.
Type the following command and press Enter:
bash
brew
If Homebrew is installed: You will see a list of available Homebrew commands and options.
If Homebrew is NOT installed: You will get the same "command not found" error as in Method 1.
Method 3: Check if the executable exists in your PATH
This command checks if the brew executable is found in any of the directories listed in your system's PATH variable.
Open your macOS Terminal application.
Type the following command and press Enter:
bash
which brew
If Homebrew is installed: You will see the full path to the brew executable, typically something like:
code
/opt/homebrew/bin/brew
or
code
/usr/local/bin/brew
If Homebrew is NOT installed: You will get a message indicating it wasn't found (the exact message varies by shell, e.g., brew not found).
In summary:
The brew --version command is the most definitive way. If it prints a version number, Homebrew is installed and ready to use. If you get a "command not found" error, it is not installed.