On the face of it, the only differences appear to be
-r-xr-xr-x 3 bin root 88620 Jul 16 1997 /usr/bin/sh
-r-xr-xr-x 2 bin root 251712 Jul 16 1997 /sbin/sh
and
/sbin/sh: ELF 32-bit MSB executable SPARC Version 1, statically linked, stripped
/usr/bin/sh: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
/sbin contains statically linked binaries, that is - they have been built containing all external functions and routines that they need so are ready to go and independent of the libraries. The /usr/bin executables on the other hand are dynamically linked, that is, they will gather any external functions/routines that they need at runtime. As an example, consider root's standard shell as seen in /etc/passwd, which is /sbin/sh. If you had a problem with shared libraries and were using /usr/bin/sh instead of /sbin/sh as the standard shell for root, then it is possible that you would not be able to run a root shell (and fix the problem). /sbin/sh (the statically linked one) still runs, even if there is a problem with the libraries, because it already has everything it needs. Consequently, the /sbin binaries are larger than the /usr/bin binaries. In Solaris 8 /sbin/sh is approx 275K whereas /usr/bin/sh is approx 95K. Downside of statically linked programs though is that they would need to be recompiled if the libraries change, the dynamically linked files wouldn't because they access the libraries at runtime.
The description above is also a good reason for not changing the standard shell for the user root.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.