The which command tells you where some program is located. This assumes that the program is in your PATH. For example:
$ which ldd /usr/bin/ldd
$ which source source: shell built-in command
This simply tells us that source is a built-in command in the shell, that is no real program (it has no binary file on the machine). Another example:
$ which javac javac: aliased to /usr/j2sdk1.4.2/bin/javac
This tells us that javac is an alias for (in this case) a binary located in /usr/j2sdk1.4.2/bin/javac.