~ % $ brew install git zsh: command not found: $ on Mac 10.15.5

Hey everyone, first of all my experience on programming is zero, so thanks in advance if anyone is willing to help. Homebrew was installed, but when trying to install Git, the following info shows up:

~ % brew install git zsh: command not found:

Any suggestion?

what does ls -al /usr/local/bin say?


There’s at least one word missing from the end of that error. What was it?

zsh: command not found: $

This script will install:


That’s the output of the Homebrew install script. The output of ls ... should look something like this:

total 6988
drwxrwxr-x 2088 gromgit wheel   66816 Jun 25 14:10 ./
drwxr-xr-x   18 root    wheel     576 Jun 22 18:14 ../
-rw-r--r--    1 gromgit wheel       0 Sep 19  2019 .keepme
lrwxr-xr-x    1 gromgit wheel      38 Jun 22 19:24 411toppm -> ../Cellar/netpbm/10.86.13/bin/411toppm*
lrwxr-xr-x    1 gromgit wheel      30 Jun 22 19:38 7z -> ../Cellar/p7zip/16.02_2/bin/7z*

I assume you literally typed:

$ brew install git

in your command line. The $ represents the shell prompt (yours seems to be %), and is not part of the command. The actual command is just:

brew install git

$ is especially useful in examples like this:

$ cd foo-0.1
$ brew diy
./configure --prefix=/usr/local/Cellar/foo/0.1
$ ./configure --prefix=/usr/local/Cellar/foo/0.1
$ make && make install
$ brew link foo
Linking /usr/local/Cellar/foo/0.1… 17 symlinks created

as an easy way to differentiate between the commands to be typed, and the outputs of said commands.

Indeed, brew install git works!