{"id":36722,"date":"2019-10-31T22:13:23","date_gmt":"2019-10-31T19:13:23","guid":{"rendered":"https:\/\/prohoster.info\/blog\/raznitsa-mezhdu-bin-sbin-usr-bin-usr-sbin\/"},"modified":"2019-10-31T22:13:23","modified_gmt":"2019-10-31T19:13:23","slug":"raznitsa-mezhdu-bin-sbin-usr-bin-usr-sbin","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/raznitsa-mezhdu-bin-sbin-usr-bin-usr-sbin","title":{"rendered":"The difference between bin, sbin, usr\/bin, usr\/sbin","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><i>On November 30, 2010, David Collier wrote:<\/i><\/p>\n<blockquote><p>I noticed that in busybox, the links are spread across these four directories.<br \/>\nIs there any simple rule to determine which link belongs in which directory?<br \/>\nFor example, kill is in \/bin, while killall is in \/usr\/bin\u2026 I don\u2019t see any logic in such a division.<\/p><\/blockquote>\n<p>\nYou probably know that Ken Thompson and Dennis Ritchie created Unix on the PDP-7 in 1969. Well, around 1971, they upgraded to the PDP-11 with a couple of RK05 drives (1.5 megabytes each).<\/p>\n<p>As the operating system grew and could no longer fit on the first disk (where the root filesystem was located), they moved part of it to a second disk, where the home directories were located (hence the mount point was called \/usr \u2014 from the word user). They duplicated all necessary OS directories (\/bin, \/sbin, \/lib, \/tmp, etc.) there and stored files on the new disk because the old one ran out of space. Then they got a third disk, mounted it in the \/home directory, and moved the users' home directories there so that the OS could occupy all the remaining space on the two disks, which were. <b>a whole three megabytes<\/b> (wow!).<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<p>Of course, they had to introduce a rule that 'when the operating system boots, it must be able to mount the second disk in the \/usr directory, so don\u2019t place programs like mount on the second disk in \/usr, otherwise we\u2019ll have a chicken-and-egg problem.' It was that straightforward. And this applied to Unix V6 35 years ago.<\/p>\n<p>The separation of \/bin and \/usr\/bin (and all similar directories) is a consequence of those events, a detail of implementation from the 70s that has been copied by bureaucrats for decades. They never asked the question <i>why<\/i>, they just did it that way. This separation ceased to make sense even before Linux was created, for several reasons:<\/p>\n<ol>\n<li>At boot time, initrd or initramfs is used, which takes care of issues like 'this file is needed earlier than that one.' Thus, we <i>already have<\/i> a temporary filesystem that is used to boot everything else. <\/li>\n<li>Shared libraries (which were added to Unix by the folks at Berkeley) do not allow you to independently change the contents of \/lib and \/usr\/lib. These two parts must correspond to each other, or they will not work. This did not happen in 1974, as they had some independence back then due to static linking. <\/li>\n<li>Cheap hard drives broke the 100 megabyte barrier somewhere around 1990, and about the same time, programs for resizing partitions emerged (partition magic 3.0 was released in 1997). <\/li>\n<\/ol>\n<p>\nNaturally, since there was separation, some people devised rules that justified it. Like, the root partition is needed for all sorts of common OS stuff, and \/usr should contain your local files. Or in \/, there is what AT&amp;T distributes, and in \/usr \u2014 what your distribution, IBM AIX, or Dec Ultrix, or SGI Irix has added, and in \/usr\/local are files specific to your system. Then someone decided that \/usr\/local wasn't a suitable place to install new software, so they added \/opt! I wouldn't be surprised if \/opt\/local appears next...<\/p>\n<p>Over 30 years, due to such a division, various interesting rules specific to different distributions have appeared and disappeared. For example, \"\/tmp is cleared at reboot, while \/usr\/tmp is not.\" (And in Ubuntu there is no \/usr\/tmp at all, while in Gentoo \/usr\/tmp is a symbolic link to \/var\/tmp, which now follows that rule, and it is not cleared at reboot. Yes, all of this was before tmpfs. There are also cases when the root filesystem is read-only, and then nothing should be written to \/usr; writing should be done in \/var. Or in \/ <i>mostly<\/i> you can't write, except for what is in \/etc, which was sometimes attempted to be moved to \/var...<\/p>\n<p>Bureaucrats like the Linux Foundation (which absorbed the Free Standards Group ages ago during expansion) happily document and complicate these rules, without even attempting to understand why they came about. They have no clue that Ken and Dennis simply moved part of the OS to their home directory because the RK05 disk on the PDP-11 was too small.<\/p>\n<p>I am almost certain that busybox simply places files as it has historically developed. There is no real reason to keep doing it this way. Personally, I just make \/bin, \/sbin, and \/lib symlinks to their corresponding directories in \/usr. After all, people who work with embedded software try to understand and simplify...<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/143614\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>30 \u043d\u043e\u044f\u0431\u0440\u044f 2010 \u0433\u043e\u0434\u0430 \u0414\u044d\u0432\u0438\u0434 \u041a\u043e\u043b\u043b\u0438\u0435\u0440 (David Collier) \u043f\u0438\u0441\u0430\u043b: \u042f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432 busybox \u0441\u0441\u044b\u043b\u043a\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u043e \u044d\u0442\u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0451\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c. \u0415\u0441\u0442\u044c \u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u0441\u0441\u044b\u043b\u043e\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u043b\u0435\u0436\u0430\u0442\u044c\u2026 \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, kill \u043b\u0435\u0436\u0438\u0442 \u0432 \/bin, \u0430 killall \u2014 \u0432 \/usr\/bin\u2026 \u042f \u043d\u0435 \u0432\u0438\u0436\u0443 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0438. \u0412\u044b, [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-36722","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"30 \u043d\u043e\u044f\u0431\u0440\u044f 2010 \u0433\u043e\u0434\u0430 \u0414\u044d\u0432\u0438\u0434 \u041a\u043e\u043b\u043b\u0438\u0435\u0440 (David Collier) \u043f\u0438\u0441\u0430\u043b: \u042f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432 busybox \u0441\u0441\u044b\u043b\u043a\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u043e \u044d\u0442\u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0451\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c. \u0415\u0441\u0442\u044c \u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/raznitsa-mezhdu-bin-sbin-usr-bin-usr-sbin\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 bin, sbin, usr\/bin, usr\/sbin | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"30 \u043d\u043e\u044f\u0431\u0440\u044f 2010 \u0433\u043e\u0434\u0430 \u0414\u044d\u0432\u0438\u0434 \u041a\u043e\u043b\u043b\u0438\u0435\u0440 (David Collier) \u043f\u0438\u0441\u0430\u043b: \u042f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432 busybox \u0441\u0441\u044b\u043b\u043a\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u043e \u044d\u0442\u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0451\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c. \u0415\u0441\u0442\u044c \u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/raznitsa-mezhdu-bin-sbin-usr-bin-usr-sbin\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T19:13:23+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T19:13:23+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47The difference between bin, sbin, usr\/bin, usr\/sbin | ProHoster","description":"On November 30, 2010, David Collier wrote: I noticed that in busybox the links are spread across these four directories. Is there a simple rule to determine where each goes?","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/raznitsa-mezhdu-bin-sbin-usr-bin-usr-sbin","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 bin, sbin, usr\/bin, usr\/sbin | ProHoster","og:description":"30 \u043d\u043e\u044f\u0431\u0440\u044f 2010 \u0433\u043e\u0434\u0430 \u0414\u044d\u0432\u0438\u0434 \u041a\u043e\u043b\u043b\u0438\u0435\u0440 (David Collier) \u043f\u0438\u0441\u0430\u043b: \u042f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432 busybox \u0441\u0441\u044b\u043b\u043a\u0438 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u044b \u043f\u043e \u044d\u0442\u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0451\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u043c. \u0415\u0441\u0442\u044c \u043b\u0438 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/raznitsa-mezhdu-bin-sbin-usr-bin-usr-sbin","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T19:13:23+00:00","article:modified_time":"2019-10-31T19:13:23+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"36722","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-22 04:34:22","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 01:40:22","updated":"2026-01-22 04:34:22","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/36722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=36722"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/36722\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=36722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=36722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=36722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}