I installed some packages via brew. But I can not find where they are.

I can not get access by typing hping on terminal

% brew install hping
Warning: hping-3.20051105 already installed
  • My hping is installed in /usr/local/Cellar/hping/3.20051105/sbin/hping – Mateusz Szlosek Sep 16 '14 at 7:55
  • I had the same problem with daemonize, this answer helped me understand that daemonize is installed in /usr/local/sbin that was not in the PATH – jakub.g Feb 28 '17 at 16:32

10 Answers 10


Use the following to show the installation path of a package:

brew info hping

Example output:

pcre: stable 8.35 (bottled)
/usr/local/Cellar/pcre/8.35 (146 files, 5.8M) *
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/pcre.rb
==> Options
    Build a universal binary
  • 7
    Is it possible to get only path? In my case I want to use clang from llvm and after "brew install llvm" clang is still apple's, but one from llvm binaries is what I need. – okutane Sep 9 '16 at 6:51
  • 1
    BTW brew doctor might help you understand issues as well. – jakub.g Feb 28 '17 at 16:34
  • 3
    @okutane You would need to assemble the path yourself. As a crude example, you could do echo "$(brew --cellar llvm)/$(brew list --versions llvm | tr ' ' '\n' | tail -1)/bin/clang" – nburr Mar 7 '18 at 16:37
  • Depending on your specific needs, brew --prefix hping (from @capripot's answer) may do the trick. – waldyrious Jan 4 at 17:59

/usr/local/Cellar is the default location on OS X. You'll see subdirectories in there for all your installed formulae...


To figure out where your formula is installed, just type do brew --prefix hping

You can also relink your hping binary by doing brew unlink hping && brew link hping

Also maybe your $PATH is not well defined. Does the list given by echo $PATH contains the result given by echo $(brew --prefix)'/bin:'$(brew --prefix)'/sbin'? This path should be toward the beginning of the list to be prioritized over system binaries, surely before /usr/bin.

To do so, you can add this at the end of your ~/.zshrc or ~/.bashrc:

export PATH=$(brew --prefix)/bin:$(brew --prefix)/sbin:$PATH

As a result, after opening a new terminal or doing source ~/.zshrc, you'll be able to echo your correct path as:

$ echo $PATH
  • Thank you, brew --prefix <command> was exactly what I needed. – waldyrious Jan 4 at 17:57

Normally, homebrew installs packages into /usr/local/bin. So you need to check that your PATH contains that directory, like this:

echo $PATH

Also, try running

brew doctor

to make sure your setup is correct. If /usr/local/bin is not in your PATH, you need to edit ~/.profile and add a line like this:

export PATH=$PATH:/usr/local/bin

Then start a new Terminal (in order to re-read your login profile) and try again.

If all that fails, it must be installed somewhere else. You can search for it by running a command like this:

sudo find / -name hping -type f
  • 2
    These are symlinks. The actual packages are in /usr/local/Cellar as @PapaStanley points out. – Steve Aug 18 '15 at 1:06

Try this command

brew --cellar <FORMULA>


brew --cellar hping
  • Alternatively, brew --prefix hping may be helpful as well. – waldyrious Jan 4 at 17:59

hping requires root privileges to run.

You probably need to add /usr/local/sbin to your PATH.

When I ran brew doctor:

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
    echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile

I recommend adding the following line to your ~/.bash_profile (or the equivalent configuration file if you are using a different shell):

export HOMEBREW_CASK_OPTS="--appdir=/Applications"

I installed some packages via brew. But I can not find where they are.

It seems that homebrew requires one to be explicit with things. Fortunately, a bit of escaping using brew --prefix can make this a no-brainer, for those who need to find the path for the pkg-config utility, e.g.

PKG_CONFIG_PATH=`brew --prefix hping`/lib/pkgconfig/ pkg-config --cflags hping

(Except this isn't going to work anyway, because it seems hping doesn't come with hping.pc .. although, in the case where package maintainers do put .pc files, this trick can be useful.)


If someone looking for real path of package:

In my case brew --cellar opencv3 gives /usr/local/Cellar/opencv

But find /usr/local/Cellar/ -type d -name "*opencv*" -maxdepth 1 gives

/usr/local/Cellar//opencv3(which is /usr/local/Cellar/opencv3 actually).






I could find any direct CLI option in brew to get the full path to the currently installed version of a formula but this would work as long as you are using bash:

echo $(brew --cellar asciidoctor)/$(brew info --json asciidoctor | jq -r '.[0].installed[0].version')
# /usr/local/Cellar/asciidoctor/1.5.8

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .