Necessary code or trash?

Matthew Graybosch matthew at
Thu Aug 28 14:31:09 PDT 2003

On 00:52 Tue 29 Aug     , Denis Troshin wrote:
> Hi!
> I have FreeBSD 5.0-RELEASE.
> Why most of bin (sbin) utilities are so big.
> For example,
>  rm   - 410 268 bytes,
>  mv   - 407 568 bytes,
>  date - 423 748 bytes.
> Do they really contain only necessary code or
> have more than a half of trash?

As others explained these commands and others are statically linked so that
they do not depend on libraries that live in /usr. Since these are very
basic commands, it's a bad idea to have them depend on a library that might
not be available if only the / filesystem is mounted. 

Since / usually just contains /root, /bin, /sbin and a couple of others, 
statically linked programs in /bin and /sbin are always available, even 
in single user mode. Booting into single user only mounts /bin, which is why
some people on the list have advised sticking with /bin/sh when asked about
changing root's login shell.

Hope this helps.

Matthew Graybosch
"The best way to lose an argument is to throw the first punch."

More information about the freebsd-questions mailing list