I have problem when I used brew to install aircrack-ng. I found out that it cover path


but it couldn't find commands after I tried tab-completion in path


What should I do? Do I need to add another path?

  • 3
    Have you tried brew doctor already? Does it say something about your PATH? – myhd Aug 30 '12 at 10:00

The sbin directory, which some admin tools like dsniff and aircrack install to, is not on the path by default, and it's not in Homebrew's initial setup instructions, which tell you to get /usr/local/bin on your path. This is because, traditionally, sbin/ is for administrative tools that only root would expect to run.

Tab completion is picking up the files in /usr/local/Cellar/aircrack-ng/1.1/bin because they are symlinked in to /usr/local/bin, which is on your PATH. It does not find the files in /usr/local/Cellar/aircrack-ng/1.1/sbin, because they are symlinked in to /usr/local/sbin, which is not on your PATH. Your current working directory does not matter for tab-completion, because . (the current directory) is not on the PATH.

If you want to see those other programs on your path, where tab-completion can pick them up, add /usr/local/sbin to your PATH in the same place you added /usr/local/bin - probably your ~/.bashrc file.

In general, if you want to use tab-completion on programs in the current directory, you need to call them with a ./ prefix. For example, cd /usr/local/sbin and then type ./air and hit tab, and you'll get some choices.


By convention, .../bin directories are for all users, .../sbin directories are for usage by root only. I don't know the setup if homebrew, but maybe /usr/local/Cellar/aircrack-ng/1.1/sbin is on the path if you are root?

You must log in to answer this question.

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