Document ID: 1559 SYNOPSIS: How to find out more about a given binary DETAIL DESCRIPTION: How to find more about a given binary. SOLUTION SUMMARY: Some very useful command in Solaris to find more about a given binary. All you ever wanted to know of a given binary. Command Typical use Output Comments ------- ----------- --------- -------------------------------- which which ld /usr/bin/ld Looks at your $path and says which executable you will get. whereis whereis ld ld: /usr/bin/ld Looks in a bunch of standard places to give you a clue about where something is. what what /bin/ld /bin/ld: Prints out version info from binary. ldd ldd /bin/ldd List dynamic dependencies tells you what libraries it wants and where it is expecting to find them. N.B. THIS CAN SAVE YOU MANY PROBLEMS! Run this early; you may get a surprise. ldd /bin/ld -lc.1 => /usr/lib/libc.so.1.10 -ldl.1 => /usr/lib/libdl.so.1.0 file file /bin/ld Makes a guess about file contents Uses /etc/magic, can set up your own file /bin/ld /bin/ld: sparc demand paged dynamically linked etc. size size /bin/ld How big is an executable? text data bss dec hex 122880 32768 40104 195752 2fca8 nm nm /bin/ld name list -- doesn't have one if stripped nm /usr/lib/libc.so.1.10 000015f8 T .div 00000790 T .mul 00027798 T .ptr_call 000024d8 T .rem 00022c08 T .stret1 etc etc. version version `which CC` version info -- only for SPARCompilers version-id of "/opt/SUNWspro/bin/CC": SC2.0.1 showrev showrev -c /bin/ld Prints the revision info for command. DATE APPROVED: 03/29/98 KEYWORDS: which where what ldd file size nm showrev sparc OS RELEASE: 2.x