Unix filesystem: Difference between revisions

Content deleted Content added
Conventional directory layout: No point using indenting if use the full path; the indenting makes the right column narrow but the right has lots of content so needs the width
Thunder491 (talk | contribs)
m Move {{Redirect}} to relevant section
 
(One intermediate revision by one other user not shown)
Line 1:
{{Short description|Directory structure used by a Unix-like operating system}}
{{Redirect|Usr||USR (disambiguation){{!}}USR}}
{{Redirect|Unix file system|UFS, a specific file system used by many Unix and Unix-like operating systems|Unix File System}}
[[File:Version 7 UNIX SIMH PDP11 Filesystem Layout.png|thumb|[[Version 7 Unix]] filesystem layout: subdirectories of "/" and "/usr"]]
Line 16 ⟶ 15:
In the original [[Research Unix|Bell Labs Unix]], a two-disk setup was customary, where the first disk contained startup programs, while the second contained users' files and programs. This second disk was mounted at the empty directory named <code>usr</code> on the first disk, causing the two disks to appear as one filesystem, with the second disk’s contents viewable at <code>/usr</code>.
 
Unix directories do not ''contain'' files. Instead, they contain the names of files paired with references to so-called [[inode]]s, which in turn contain both the file and its [[metadata]] (owner, permissions, time of last access, etc., but no name). Multiple names in the file system may refer to the same file, a feature termed a ''[[hard link]]''.<ref name="Ritchie"/> The mathematical traits of hard links make the file system a limited type of [[directed acyclic graph]], although the ''directories'' still form a tree, as they typically may not be hard-linked.<!--Mac OS X allows this, according to the article 'Hard link'.--> (As originally envisioned in 1969, the Unix file system would in fact be used as a general graph with hard links to directories providing navigation, instead of path names.<ref name="evolution">{{cite conference |first=Dennis M. |last=Ritchie |year=1979 |title=The Evolution of the Unix Time-sharing System |conference=Language Design and Programming Methodology Conf. |url=http://cm.bell-labs.com/cm/cs/who/dmr/hist.html |access-date=2014-04-20 |archive-date=2015-04-08 |archive-url=https://web.archive.org/web/20150408054606/http://cm.bell-labs.com/cm/cs/who/dmr/hist.html |url-status=dead }}</ref>)
 
===File types===
Line 26 ⟶ 25:
 
==Conventional directory layout==
{{Redirect|Usr||USR (disambiguation){{!}}USR}}
Certain conventions exist for locating some kinds of files, such as programs, system configuration files, and users' [[home directory|home directories]]. These were first documented in the <code>hier(7)</code> [[man page]] since [[Version 7 Unix]];<ref name="v7">{{man|7|hier|v7}}</ref> subsequent versions, derivatives and clones typically have a similar man page.<ref>{{man|7|hier|FreeBSD}}</ref><ref name="openbsd">{{man|7|hier|OpenBSD}}</ref><ref>{{cite web|title=hier(7) man page for 2.9.1 BSD|url=http://www.freebsd.org/cgi/man.cgi?query=hier&manpath=2.9.1+BSD}}</ref><ref>{{cite web|title=hier(7) man page for ULTRIX 4.2|url=http://www.freebsd.org/cgi/man.cgi?query=hier&manpath=ULTRIX+4.2}}</ref><ref>{{cite web|title=hier(7) man page for SunOS 4.1.3|url=http://www.freebsd.org/cgi/man.cgi?query=hier&manpath=SunOS+4.1.3}}</ref><ref>{{man|7|hier|Linux}}</ref>
 
Line 116:
|
<code>/usr/libexec</code>
|Holds programs meant to be executed by other programs rather than by users directly. E.g., the [[Sendmail]] executable may be found in this directory.<ref>{{cite web |url=http://docs.cray.com/books/S-2341-22/html-S-2341-22/z1028736068smg.html |website=[[UNICOS]]/mp Networking Facilities Administration |publisher=[[Cray]] |title=Chapter 7. sendmail |access-date=14 September 2013 |archive-date=9 November 2017 |archive-url=https://web.archive.org/web/20171109075438/http://docs.cray.com/books/S-2341-22/html-S-2341-22/z1028736068smg.html |url-status=dead }}</ref> Not present in the FHS until 2011;<ref>{{cite web |url=http://bzr.linuxfoundation.org/loggerhead/lsb/devel/fhs-spec/revision/44 |title=fhs-spec revision 44 |access-date=2016-07-14 |archive-date=2017-03-05 |archive-url=https://web.archive.org/web/20170305015621/http://bzr.linuxfoundation.org/loggerhead/lsb/devel/fhs-spec/revision/44 |url-status=dead }}</ref> Linux distributions have traditionally moved the contents of this directory into <code>/usr/lib</code>, where they also resided in 4.3BSD.
|-
|