TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Understanding the bin, sbin, usr/bin, usr/sbin Split [pdf]

127 pointsby Somasisabout 10 years ago

10 comments

bobbaabout 10 years ago
Can we also address .bash_rc, .bash_profile, .profile, /etc/bash.bashrc, disambiguation. I get tired of instructions advising me to put PATH and other modifiers in .bash_profile when that only works for a login shell. Doesn't work, as needed, if you are actually using Linux as your desktop system.
评论 #9555114 未加载
评论 #9556609 未加载
ghshephardabout 10 years ago
I personally like the differentiation between &#x2F;sbin (71 files) and &#x2F;usr&#x2F;sbin (195 files) on OpenBSD and &#x2F;bin (42 files) and &#x2F;usr&#x2F;bin (336 files).<p>I don&#x27;t know if it&#x27;s still the case, but at one point, everything required to boot up a system, and get to a ksh prompt, was in &#x2F;sbin and &#x2F;bin, and the only purpose for commands in &#x2F;usr was for user interaction.<p>When mentally modelling the purpose of the commands, it was nice to have that differentiation, particular the &quot;Stuff in &#x2F;usr is really for the user only, not needed to boot a system.&quot;<p>Of course, I have no idea whether that still holds true - but it&#x27;s still a good starting point.
评论 #9555487 未加载
评论 #9555300 未加载
cremnoabout 10 years ago
&gt;I’m still waiting for &#x2F;opt&#x2F;local to show up...<p>Well, he doesn&#x27;t have to wait anymore:<p><a href="https:&#x2F;&#x2F;trac.macports.org&#x2F;wiki&#x2F;FAQ#defaultprefix" rel="nofollow">https:&#x2F;&#x2F;trac.macports.org&#x2F;wiki&#x2F;FAQ#defaultprefix</a><p>&gt;Why is &#x2F;opt&#x2F;local the default install location for MacPorts?
frikabout 10 years ago
There are&#x2F;were small Linux distro that fit on a 3.5&quot; floppy diskette. I remember one that required just a single floppy disk to boot and a later version came with a second floppy with additional applications. So the bin &#x2F;usr&#x2F;bin split was still useful in the early Linux era (I used such a floppy Linux til 2002 for misc purposes). A starting point: <a href="http:&#x2F;&#x2F;superuser.com&#x2F;questions&#x2F;130457&#x2F;what-linux-fits-on-a-floppy-disk" rel="nofollow">http:&#x2F;&#x2F;superuser.com&#x2F;questions&#x2F;130457&#x2F;what-linux-fits-on-a-f...</a>
egwynnabout 10 years ago
The reasons for the complexity are lame, but sometimes there are nice consequences. For instance, on FreeBSD you can pretty much just nuke <i>&#x2F;usr&#x2F;local&#x2F;</i> and be left with a functional base-system (broken configs notwithstanding).
ChuckMcMabout 10 years ago
Interesting rant. Actually in 1990 people were complaining that SunOS took up too much disk space (well they always complained but whatever). And C (and unix) always had something of a naming &#x2F; packaging problem.<p>Of course long after the size of disks were &quot;big enough&quot; to hold everything in &#x2F; putting things on different drives gave you more disk I&#x2F;O&#x27;s to play with and improved overall system performance. If you could get small drives today you could play with that yourself but it seems silly to have a 500GB disk mounted on &#x2F;var&#x2F;log :-).<p>But more importantly for me over the years was putting the &quot;OS&quot; required user land stuff in one place and the &quot;rest&quot; of it in another place meant I could replace the kernel and userland code independently of restoring home directories and what not. These days I do that by mounting &quot;my&quot; stuff via NFS and making my servers basically completely replaceable with a re-imaging.
brandonmencabout 10 years ago
The original version:<p><a href="http:&#x2F;&#x2F;lists.busybox.net&#x2F;pipermail&#x2F;busybox&#x2F;2010-December&#x2F;074114.html" rel="nofollow">http:&#x2F;&#x2F;lists.busybox.net&#x2F;pipermail&#x2F;busybox&#x2F;2010-December&#x2F;074...</a><p>I make everyone I hire and&#x2F;or work with read it.
评论 #9557152 未加载
GutenYeabout 10 years ago
Well, Arch Linux simplify them all, everything is in usr&#x2F;bin and others just symlink to usr&#x2F;bin.
评论 #9555572 未加载
评论 #9555578 未加载
评论 #9554920 未加载
DougMerrittabout 10 years ago
It gets the &#x2F;sbin part wrong.<p>&#x2F;sbin and &#x2F;usr&#x2F;sbin&#x2F; did not exist in the 1970s at all, let alone in the early 1970s.<p>I&#x27;m not sure exactly which system it first appeared in, but on BSD, which originally was add-ons to the Bell Labs distribution, it was not present in the 1986 4.3 BSD but did appear in the 1993 4.4 BSD.<p>You can verify that, and search for it on other early Unixes, here, for instance:<p><a href="http:&#x2F;&#x2F;minnie.tuhs.org&#x2F;cgi-bin&#x2F;utree.pl" rel="nofollow">http:&#x2F;&#x2F;minnie.tuhs.org&#x2F;cgi-bin&#x2F;utree.pl</a>
davidwabout 10 years ago
See also: Filesystem Hierarchy Standard:<p><a href="https:&#x2F;&#x2F;wiki.debian.org&#x2F;FilesystemHierarchyStandard" rel="nofollow">https:&#x2F;&#x2F;wiki.debian.org&#x2F;FilesystemHierarchyStandard</a>