How to find out more about a given binary

All you ever wanted to know about a given binary.

Command Description / Example
which Looks at your $PATH and displays which executable you will get
# which ld
whereis Looks in a bunch of standard places to give a clue about where something is
# whereis ld
ld: /usr/bin/ld
what Prints out version info from binary
# what /usr/bin/ld
ldd List dynamic dependencies tells you what libraries it wants and where it is expecting to find them
# ldd /usr/bin/ld
-lc.1 => /usr/lib/
-ldl.1 => /usr/lib/
file Makes a guess about file contents. Uses /etc/magic
# file /usr/bin/ld
/usr/bin/ld:        sparc depend paged dynamically linked
size How big is an executable
# size /usr/bin/ld
text    data    bss     dec     hex
122880  32768   40104   195752  2fca8
nm name list — doesn't have one if stripped
# nm /usr/bin/ld
nm /usr/lib/
000015f8 T .div
00000790 T .mul
00027798 T .ptr_call
000024d8 T .rem
00022c08 T .stret1
version version info — only for SPARCcompilers
# version `which CC`
    version-id of "/opt/SUNWspro/bin/CC":  
showrev Print the revision info for command
# showrev -c /usr/bin/ld
PATH is:
PWD is:
LD_LIBRARY_PATH is not set in the current environment
File: /usr/bin/ld
File type: ELF 32-bit MSB executable SPARC Version 1, 
      dynamically linked, stripped
Command version: SunOS 5.8 Generic February 2000
File mode: r-xr-xr-x
User owning file: root
Group owning file: bin
Library information: => /usr/lib/
      ldl.1 => /usr/lib/
Sum: 48668