4 ms·
/bin, /usr/bin, /usr/local/bin, /opt... is a mess on unices. There is no profound idea behind it. Someone needed a folder that was not interfered with, then som
by arghwhat 9y ago
/bin, /usr/bin, /usr/local/bin, /opt... is a mess on unices. There is no profound idea behind it. Someone needed a folder that was not interfered with, then someone started interfering so a new folder was born, and so forth. However, they are mostly just prioritized copies of eachother. / comes first, then /usr, then /usr/local, then /opt. The structures in them are identical.
On Windows, however, the only organized region would be that applications get a folder, but there's multiple potential locations (Program Files, Program Files (x86)), and they might also dump a bunch of things in various user-local folders, as well as the giant landfill that is C:\Windows. It lacks structure, to the point where there is even clones of UNIX structures in there (C:\Windows\System32\drivers\etc\hosts?!?).
- h1d 9y agoFirst you got /bin on boot, enough to mount an external drive to mount /usr and you're set. That's what I heard was the case back then. These days it's non sensical and I heard about an effort to symlink either of it to the other and consolidate the binaries. /opt is alright. It's where you dump your tar ball and compile your custom stuff and place it under not to mix stuff up with package managed software. Not sure how people differentiate against /usr/local though.
- toyg 9y ago/usr/local vs /opt, afaik, is mostly a case of 3rd-party commercial software ending up under /opt, whereas your more personal scripts and hacks are in /usr/local. I'm not particularly bothered about /bin vs /usr/bin, these days everything is in /usr/bin -- unless you are in an embedded scenario, and at that point everything is custom anyway. The one location that doesn't make sense is /usr/sbin, which is hopefully being phased out. Tbh the only thing I really miss is having ~/bin in PATH by default (and ~/lib, ~/share etc similarly picked up where necessary), since installing software in personal userspace is still pretty common in real multiuser environments; standardizing that would help, imho.
- gh02t 9y ago> Tbh the only thing I really miss is having ~/bin in PATH by default (and ~/lib, ~/share etc similarly picked up where necessary), since installing software in personal userspace is still pretty common in real multiuser environments; standardizing that would help, imho. Not sure that will become standardized, it's a big security risk. Usually you want ~/bin to be at the front of your PATH so it takes priority, but the downside is... well that it takes priority. It's easy for someone to subvert the stuff in PATH because they only need your permissions.
- arghwhat 9y agoHomebrew use /usr/local/bin, macports use /opt, so if you want to be "safe", you'd need to make yet another location... Arch undid this, but did it the silly way by letting /bin be a symlink to /usr/bin. I would have preferred it the other way around.
- yellowapple 9y ago"These days it's non sensical and I heard about an effort to symlink either of it to the other and consolidate the binaries." Yeah, Fedora wants to move everything to /usr, last I heard. I personally think it's a stupid idea (/usr is just a vestige of Unix's early development and was never meant to be a permanent part of the Unix filesystem layout) and would prefer everything to be under /, but whatever. "Not sure how people differentiate against /usr/local though." /usr/local is typically reserved for stuff built from source. OpenBSD also uses it for things installed via the package manager. /opt is a lot more freeform. Yeah, you can create an /opt/bin or /opt/lib or what have you, but the way I've seen it used (and the way I personally use it) is something closer to Program Files (so I'll have /opt/firefox or /opt/julia or whatever). A lot of commercial software packages will install to /opt in a similar manner.
- lobster_johnson 9y agoFun fact: /usr exists because Thompson and Ritchie ran out of disk space on the root disk of their PDP-11 [1] in the early 1970s. /usr was originally where the user's files (everything but the OS) lived, but when they ran out of space they decided to just move OS stuff into it. The whole "/bin is available on boot until /usr is mounted" story, which a classic form of post-rationalization, though it was presumably a useful distinction for a while. [1] http://lists.busybox.net/pipermail/busybox/2010-December/074114.html http://lists.busybox.net/pipermail/busybox/2010-December/074...
- JdeBP 9y agoThat's one-sided and misleading. In fact, the Windows model of "/Program Files/%COMPANY_OR_PERSON%/%PACKAGE%/", "%USERPROFILE%/AppData/Local/%COMPANY_OR_PERSON%/%PACKAGE%/", and suchlike is akin to NeXTSTEP's ~/Apps, /LocalLibrary, /LocalApps, and so forth; both are from the early 1990s. Similarly, the Windows organization of %USERPROFILE%/AppData/Local/ , %USERPROFILE%/AppData/Local/Temp/ , and so forth has a parallel on Freedesktop operating systems. * https://unix.stackexchange.com/a/313001/5132 https://unix.stackexchange.com/a/313001/5132 And of course as indicated on this very page at https://news.ycombinator.com/item?id=14927512 https://news.ycombinator.com/item?id=14927512 and https://news.ycombinator.com/item?id=14926999 https://news.ycombinator.com/item?id=14926999, interference was not the reason for the creation of /usr . People have also observed on this very page that far from being new-fangled, as it has been mischaracterized on this page, GoboLinux has been around and doing things like this for almost a decade and a half. (Of course, as NextSTEP and Windows NT 3.5 show, the idea is almost a decade and a half older than that, even.) It is interesting to note that slightly earlier than that, Daniel J. Bernstein, around the turn of the century, proposed a /package hierarchy (for package management without the need for conflict resolution) and a /command directory. * http://cr.yp.to/slashpackage.html http://cr.yp.to/slashpackage.html * http://cr.yp.to/slashcommand.html http://cr.yp.to/slashcommand.html * https://news.ycombinator.com/item?id=10356933 https://news.ycombinator.com/item?id=10356933 * https://news.ycombinator.com/item?id=11647304 https://news.ycombinator.com/item?id=11647304
- arghwhat 9y agoIt has been a long time since I read those email correspondences. They are quite hilarious. However, despite the pedantry, /usr/local/bin and /opt/bin are all about not interfering with /usr/bin and /bin. /usr was, of course, made to be a home folder, and converted for the silly reasons mentioned in those old emails (although this was changed back in Plan9 and Inferno), and /usr/bin has maintained a similar idea of being non-essential binaries in many current distros (/bin often belonging to one package, and /usr/bin containing many independently managed packages). You seem to have missed that I did not complain about "Program Files" being nicely organized folders containing all relevant application data (although I am highly allergic to unnecessary capitalization and poor naming), nor say that Windows was the only platform with a mess, but rather complain that there are multiple such program locations (Program Files, Program Files (x86), and some applications install to user folders), that Program Files contain a bunch of entries for things aren't programs (helpers, things that installed elsewhere for stupid reasons, etc.), that AppData is a hidden mess, and that the Windows folder is a ghastly landfill that contains everything under the sky, including things that should have gone in the other locations (system applications, libraries, ...), things that didn't fit anywhere (most of whats in here), and even configuration files in UNIX directory structures (/c/windows/system32/drivers/etc/hosts). It's a disgusting mess in there that cannot by any meaning of the word be considered organized. Note that I have not used Windows for at most 60 contiguous minutes for the past many years, so my memory may fail me.