Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

/usr/local/Cellar/aircrack-ng/1.1/bin

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

/usr/local/Cellar/aircrack-ng/1.1/sbin

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

share|improve this question
2  
Have you tried brew doctor already? Does it say something about your PATH? –  myhd Aug 30 '12 at 10:00
add comment

2 Answers

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.

share|improve this answer
add comment

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?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.