Content deleted Content added
Guy Harris (talk | contribs) →Conventional directory layout: Use citation template. |
→Conventional directory layout: Fix table’s format. |
||
Line 38:
|The slash <code>/</code> character alone denotes the root of the filesystem tree.
|-
▲:<code>/bin</code>
|Stands for ''[[computer program|binaries]]'' and contains certain fundamental utilities, such as <code>ls</code> or <code>cp</code>, that are needed to mount <code>/usr</code>, when that is a separate filesystem, or to run in one-user (administrative) mode when <code>/usr</code> cannot be mounted. In System V.4, this is a symlink to <code>/usr/bin</code>. Otherwise, it needs to be on the root filesystem itself.
|-
▲:<code>[[/boot]]</code>
|Contains all the files needed for successful booting process. In [[Research Unix]], this was one file rather than a directory.<ref name="upe"/> Nowadays usually on the root filesystem itself, unless the system, bootloader etc. require otherwise.
|-
▲:<code>[[/dev]]</code>
|Stands for ''devices''. Contains [[device node|file representations]] of peripheral devices and [[Device file#Pseudo-devices|pseudo-devices]]. See also: [[Linux Assigned Names and Numbers Authority]]. Needs to be on the root filesystem itself.
|-
▲:<code>/etc</code>
|Contains system-wide configuration files and system databases; the name stands for ''[[et cetera]]''<ref name="upe">{{cite book |first1=Brian W. |last1=Kernighan |author-link1=Brian Kernighan |first2=Rob |last2=Pike |author-link2=Rob Pike |title=The UNIX Programming Environment |publisher=Prentice-Hall |year=1984 |pages=[https://archive.org/details/unixprogramminge0000kern/page/63 63–65]|title-link=The UNIX Programming Environment |bibcode=1984upe..book.....K }}</ref> but now a better expansion is '''e'''ditable-'''t'''ext-'''c'''onfigurations. Originally also contained "dangerous maintenance utilities" such as <code>init</code>,<ref name="v7"/> but these have typically been moved to <code>/sbin</code> or elsewhere. Needs to be on the root filesystem itself.
|-
▲:<code>/home</code>
|Contains user home directories on Linux and some other systems. In the original version of Unix, home directories were in <code>/usr</code> instead.<ref name="notes72">{{cite web|last=Ritchie|first=Dennis|title=Unix Notes from 1972|url=https://www.bell-labs.com/usr/dmr/www/notes.html|access-date=14 January 2018}}</ref> Some systems use or have used different locations still: [[macOS]] has home directories in <code>/Users</code>, older versions of BSD put them in <code>/u</code>, [[FreeBSD]] has <code>/usr/home</code>.
|-
▲:<code>/lib</code>
|Originally ''essential libraries'': [[C (programming language)|C]] libraries, but not [[Fortran]] ones.<ref name="upe"/> On modern systems, it contains the shared libraries needed by programs in <code>/bin</code>, and possibly [[loadable kernel module]] or [[device driver]]s. Linux distributions may have variants <code>/lib32</code> and <code>/lib64</code> for multi-architecture support.
|-
▲:<code>/media</code>
|Default mount point for removable devices, such as USB sticks, media players, etc. By common sense, the directory itself, whose subdirectories are mountpoints, is on the root partition itself.
|-
▲:<code>/mnt</code>
|Stands for ''mount''. Empty directory commonly used by system administrators as a temporary mount point. By common sense, the directory itself, whose subdirectories are mountpoints, is on the root partition itself.
|-
▲:<code>/opt</code>
|Contains locally installed software. Originated in [[UNIX System V|System V]], which has a [[package manager]] that installs software to this directory (one subdirectory per package).<ref>''[http://www.sco.com/developers/devspecs/gabi41.pdf System V Application Binary Interface]'' Edition 4.1 (1997-03-18)</ref>
|-
▲:<code>/proc</code>
|[[procfs]] virtual [[File system|filesystem]] showing information about [[process (computing)|processes]] as files.
|-
▲:<code>/root</code>
|The home directory for the [[superuser]] ''root'' - that is, the system administrator. This account's home directory is usually on the initial filesystem, and hence not in /home (which may be a mount point for another filesystem) in case specific maintenance needs to be performed, during which other filesystems are not available. Such a case could occur, for example, if a hard disk drive suffers failures and cannot be properly mounted.
|-
▲:<code>/sbin</code>
|Stands for "[[computer program|system (or superuser) binaries]]" and contains fundamental utilities, such as <code>init</code>, usually needed to start, maintain and recover the system. Needs to be on the root partition itself.
|-
▲:<code>/srv</code>
|Server data (data for services provided by system).
|-
▲:<code>/sys</code>
|In some [[Linux distribution]]s, contains a [[sysfs]] virtual [[File system|filesystem]], containing information related to hardware and the operating system. On BSD systems, commonly a symlink to the kernel sources in <code>/usr/src/sys</code>.
|-
▲:<code>/tmp</code>
|A place for temporary files not expected to survive a reboot. Many systems clear this directory upon startup or use [[tmpfs]] to implement it.
|-
▲:<code>/unix</code>
|The Unix [[kernel (operating system)|kernel]] in Research Unix and [[UNIX System V|System V]].<ref name="upe"/> With the addition of [[virtual memory]] support to [[Berkeley Software Distribution#3BSD|3BSD]], this got renamed <code>/vmunix</code>.
|-
▲:<code>/usr</code>
|The "user file system": originally the directory holding user home directories,<ref name="notes72"/> but already by the Third Edition of [[Research Unix]], ca. 1973, reused to split the operating system's programs over two disks (one of them a 256K fixed-head drive) so that basic commands would either appear in <code>/bin</code> or <code>/usr/bin</code>.<ref name="reader">{{cite web |author-link=Doug McIlroy |author=M. D. McIlroy |date=1987 |url=http://www.cs.dartmouth.edu/~doug/reader.pdf |title=A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971–1986 |id=CSTR 139 |publisher=Bell Labs}}</ref> It now holds executables, libraries, and shared resources that are not system critical, such as the [[X Window System]], [[window manager]]s, [[scripting language]]s, etc. In older Unix systems, user home directories might still appear in <code>/usr</code> alongside directories containing programs, although by 1984 this depended on local customs.<ref name="upe"/>
|-
▲::<code>/include</code>
|Stores the development headers used throughout the system. [[Header file]]s are mostly used by the <code>#include</code> directive in [[C (programming language)|C]] language, which historically is how the name of this directory was chosen.
|-
▲::<code>/lib</code>
|Stores the needed libraries and data files for programs stored within <code>/usr</code> or elsewhere.
|-
▲::<code>/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}}</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}}</ref> Linux distributions have traditionally moved the contents of this directory into <code>/usr/lib</code>, where they also resided in 4.3BSD.
|-
▲::<code>/local</code>
|Resembles <code>/usr</code> in structure, but its subdirectories are used for additions not part of the operating system distribution, such as custom programs or files from a [[BSD]] [[Ports collection]]. Usually has subdirectories such as <code>/usr/local/lib</code> or <code>/usr/local/bin</code>.
|-
▲::<code>/share</code>
|Architecture-independent program data. On Linux and modern BSD derivatives, this directory has subdirectories such as <code>man</code> for [[manpage]]s, that used to appear directly under <code>/usr</code> in older versions.
|-
▲:<code>/var</code>
|Stands for ''variable''. A place for files that might change frequently - especially in size, for example e-mail sent to users on the system, or process-ID [[lock file]]s.
|-
▲::<code>/log</code>
|Contains system log files.
|-
▲::<code>/mail</code>
|The place where all incoming mail is stored. Users (other than <code>root</code>) can access their own mail only. Often, this directory is a [[symbolic link]] to <code>/var/spool/mail</code>.
|-
▲::<code>/spool</code>
|[[spooling|Spool]] directory. Contains print jobs, mail spools and other queued tasks.
|-
▲::<code>/src</code>
|The place where the uncompiled source code of some programs is.
|-
▲::<code>/tmp</code>
|The <code>/var/tmp</code> directory is a place for temporary files which should be preserved between system reboots.
|}
|