0

I am using Mac OS X 10.11 (El Capitan) and wanted to know what the difference is between /bin and /usr/bin/? Apparently /usr/bin/ seems to have more binaries in it like grep etc.

3

Before large disks became common, /bin (being in the root "/" partition) would be mounted first, and /usr/bin possibly a little later, to allow for disk-checking, other system maintenance. The root filesystem could be a smaller disk (with fewer programs).

That is no longer the case (large disks are common), and on some systems (Red Hat), /bin is just a symbolic link to /usr/bin. OSX is not one of those systems.

Further reading:

1

In general, /bin just contains the binaries that are probably needed for performing the most critical operations, like the "mount" command that allows a person to mount other "mount points" including the /usr "mount point".

For details, see the man page for "hier", which describes the filesystem hierarchy. Such a man page may be particularly prone to differ between different operating systems. (e.g., since you're mentioning OSX, I can refer to Apple's man page for hier).

There have been some efforts to standardize how different directories are used. The most popular standardization is the Filesystem Hierarchy Standard. Linux-based systems may be a bit more prone to follow that FHS more closely than some other operating systems. The hyperlink from Thomas Dickey's answer provides some additional comments and references, and may be good for learning some more generalizations. However, the "operating system"-specific "hier" man page is more likely to provide details that accurately reflect how things are typically done in a specific operating system, and so that man page should generally be trusted more than documentation that is less specific.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.