Linux has a great tool called whereis that allows you to find the location of an executable. For example, if you want to know what PHP binary you are using, you could use the following command.
$ whereis php /usr/local/php
However, if you run this on Mac it will often return you a black result, even though you know the command works!
$ whereis convert
The solution is to use which instead, which does the the same thing, but actually returns results.
$ which convert /opt/local/bin/convert
Great for finding those extra mysterious programmes.