The distinction between things in /bin and things in /usr/bin

13

2

What is it? ...

Ollie Saunders

Posted 2009-11-30T06:15:08.083

Reputation: 432

Answers

13

Wikipedia has a decent explanation. From that article:

  • /bin: "Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp."
  • /usr/bin: "Non-essential command binaries (not needed in single user mode); for all users."

Lawrence Velázquez

Posted 2009-11-30T06:15:08.083

Reputation: 929

For more info take a look into http://www.pathname.com/fhs/pub/fhs-2.3.html

– Marcin Gil – 2009-11-30T07:26:02.993

5In addition to their essential status, /bin should be statically linked (not try to dynamically load dependencies) which means they may be much larger files. However, they will still work even if necessary system libraries are mucked up.

/usr/bin has no such recommendation. – Broam – 2009-11-30T14:35:44.747

Most of the time, the stuff in /bin is not statically linked these days. You use busybox if you need a statically liked environment. – Ken Bloom – 2009-12-02T20:59:34.323

9

$ man hier

contains a good description of the file system hierarchy

geek

Posted 2009-11-30T06:15:08.083

Reputation: 7 120

8

In the old days of small disks, it was common to have /bin on the boot disk, and /usr/bin on a separate disk (sometimes even a shared network drive). /bin would contain anything needed to either boot the system, or fix it if /usr/bin couldn't be mounted for some reason. Its another one of those historical accidents that doesn't make as much sense today.

KeithB

Posted 2009-11-30T06:15:08.083

Reputation: 8 506

3

The distinction is simple:

/bin is where system binaries are stored (mostly these binaries are owned by root) whereas /usr/bin is the usual spot for binaries that are used by ordinary non-root users. It is also a common place to deposit binary programs that were built by the compiler to be used by other users.

t0mm13b

Posted 2009-11-30T06:15:08.083

Reputation: 723

1

A lot of times (even today, for various reasons), people create /usr as a separate filesystem. In these circumstances, / is mounted first, then programs on / are used to mount /bin. So there's a requirement that anything needed to get to the point of mounting /usr needs to live in /bin or /sbin. Additionally, anything useful in troubleshooting problems (if you can't mount /usr) is also best stored in /bin or /sbin.

Ken Bloom

Posted 2009-11-30T06:15:08.083

Reputation: 489