Linked by Thom Holwerda on Mon 30th Jan 2012 20:39 UTC
General Unix Finally something really interesting to talk about. If you've used UNIX or any of its derivatives, you've probably wondered why there's /bin, /sbin, /usr/bin, /usr/sbin in the file system. You may even have a rationalisation for the existence of each and every one of these directories. The thing is, though - all these rationalisations were thought up after these directories were created. As it turns out, the real reasoning is pretty damn straightforward.
Thread beginning with comment 505204
To read all comments associated with this story, please click here.
Comment by Brynet
by brynet on Mon 30th Jan 2012 22:43 UTC
brynet
Member since:
2010-03-02

On at least BSD, there is the hier(7) man page that documents the filesystems hierarchical layout.

/bin == statically linked binaries, standard unix programs.
/sbin == statically linked binaries, system utilities, typically intended system administrators.
/usr/bin == shared binaries, base programs for users.
/usr/sbin == shared binaries, base system utilities for users.
/usr/local/bin == shared binaries, 3rd party user programs.
/usr/local/bin == shared binaries, 3rd party system utilities.

It's not that difficult, and it's pretty easy to understand.

http://www.openbsd.org/cgi-bin/man.cgi?query=hier&manpath=OpenBSD+C...
http://www.freebsd.org/cgi/man.cgi?query=hier&manpath=FreeBSD+9.0-R...
http://netbsd.gw.com/cgi-bin/man-cgi?hier++NetBSD-current
http://developer.apple.com/library/mac/documentation/Darwin/Referen...

Edited 2012-01-30 22:44 UTC

Reply Score: 6

RE: Comment by Brynet
by leech on Mon 30th Jan 2012 23:33 in reply to "Comment by Brynet"
leech Member since:
2006-01-10

By the way, Debian GNU/Linux and Arch Linux has 'man hier' as well.

I still think that anyone who has ever complained about being confused by the FHS has not done five minutes of research into the WHY of it. It makes perfectly logical sense. And is by far one of the cleanest file structures I've ever seen, and I've seen a lot of them.

Take the Amiga for example, it's got a decent file structure for the most part, Libs, Devs, C, L, S, etc. Now for anyone who has not used an Amiga, would think "what the hell is L for?" Wait, I don't even know right now. Can't think of it, but it's laid out in a fairly organized manner. Windows on the other hand is a horrible mess. Not because of Microsoft, but because of the third party applications. The Linux Distributions (and FreeBSD) are good because the package management keeps things clean.

Reply Parent Score: 5

RE: Comment by Brynet
by laffer1 on Tue 31st Jan 2012 04:03 in reply to "Comment by Brynet"
laffer1 Member since:
2007-11-09

Not everything in /bin and /sbin is statically linked on all the BSDs. For instance FreeBSD and MidnightBSD have quite a few binaries with shared libraries in /bin. /rescue is supposed to be the safety net for this sort of thing.

Reply Parent Score: 2