We can use the ldd command to determine if a particular executable program is static:
# ldd /sbin/sln
not a dynamic executable
"not a dynamic executable" is ldd's way of saying that
sln is statically linked. Now, let's take a look at
sln's size in comparison to its non-static cousin,
ln:
# ls -l /bin/ln /sbin/sln
-rwxr-xr-x 1 root root 23000 Jan 14 00:36 /bin/ln
-rwxr-xr-x 1 root root 381072 Jan 14 00:31 /sbin/sln
As you can see, sln is over ten times the size of
ln. ln is so much smaller than sln
because it is a dynamic executable. Dynamic executables are
incomplete programs that depend on external shared libraries to provide
many of the functions that they need to run.