Unix directory structure: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Eric M Gearhart
(added line about the FHS and the LSB)
mNo edit summary
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{subpages}}
In [[computer science]], and particularly in [[Unix]]-like [[operating system]]s, the '''Unix directory structure''' is a convention of  organization.  
In [[computer science]], and particularly in [[Unix]]-like [[operating system]]s, the '''Unix directory structure''' is a convention of  organization.  


There are attempts at creating an "official" standard Unix filesystem layout, such as the "Filesystem Hierarchy Standard."<ref>{{cite web |url=http://www.pathname.com/fhs/ |title=Filesystem Hierarchy Standard |accessdate=2007-07-25}}</ref>
There are attempts at creating an "official" standard Unix filesystem layout, such as the "Filesystem Hierarchy Standard."<ref name="Filesystem Hierarchy Standard">{{cite web |url=http://www.pathname.com/fhs/ |title=Filesystem Hierarchy Standard |accessdate=2007-07-25}}</ref> Also as part of the "Linux Standards Base" a common filesystem layout is defined, to encourage interoperability among different Linux distributions.<ref name="Linux Standards Base">{{cite web |url=http://www.linux-foundation.org/en/LSB |title=Linux Standards Base |accessdate=2007-07-25}}</ref>


Also as part of the "Linux Standards Base" a common filesystem layout is defined, to encourage interoperability among different Linux distributions.<ref>{{cite web |url=http://www.linux-foundation.org/en/LSB |title=Filesystem Hierarchy Standard |accessdate=2007-07-25}}</ref>
What follows is a generalized overview of common locations of files in a Unix system:
* '''/ (root)''' -- The / notes the "root" of the filesystem, where the entire system is contained. Unlike [[Microsoft Windows]], where each drive has its own root directory named by a letter, such as C:\ or F:\, Unix holds the entire system in this single top-level directory, including each device and document. Thus, it is commonly said that in Unix, "everything is a file." Note that Unix uses the forward slash ( / ) rather than the backslash ( \ ) commonly used in Windows.


* '''/''' -- "root"; This is where the entire system is contained. Unlike [[Microsoft Windows]], where each drive has its own root directory named by a letter, such as C:/ or F:/, Unix holds the entire system in this single top-level directory, including each device and document. Thus, it is commonly said that in Unix, "everything is a file".
<br>
:* '''/bin''' -- Stands for "[[computer program|binaries]]"; Contains some fundamental utilities needed by a system administrator.  As a failsafe, these were placed in a separate directory so that they could be placed on a separate [[disk]] or [[disk partition]] in case the main drive failed.
:* '''/bin''' -- Stands for "[[computer program|binaries]]"; Contains some fundamental utilities needed by a system administrator.  As a failsafe, these were placed in a separate directory so that they could be placed on a separate [[disk]] or [[disk partition]] in case the main drive failed.
<br>
 
:* '''/etc''' -- Contains configuration and some system databases.
:* '''/etc''' -- Contains configuration files and some system databases.
 
:* '''/dev''' -- short for devices.  Contains file representations of every peripheral device attached to the system.
:* '''/dev''' -- short for devices.  Contains file representations of every peripheral device attached to the system.


::*'''[[dev-null|/dev/null]]''' -- Also known as the "bit bucket" or "black hole", this virtual file discards all contents written to it. This is typically used to throw away unwanted data streams, such as log files.
::*'''[[dev-null|/dev/null]]''' -- Also known as the "bit bucket" or "black hole", this virtual file discards all contents written to it. This is typically used to throw away unwanted data streams, such as log files.


::*'''[[dev-random|/dev/random]]''' -- This is a virtual file which contains either a [[real random number]], which often uses system noise to generate random numbers, or a [[pseudorandom number]], which is based on an algorithm, depending on the type of Unix system.
::*'''[[dev-random|/dev/random]]''' -- This is a virtual file which contains random numbers (subject to the limitations of [[Random Number Generators]] in [[Computing]]). It uses system noise to generate random numbers and blocks if not enough entropy in the noise is available. Random is commonly used more by programs that absolutely need ''high quality'' random data (such as SSH to generate an [[encryption]] key).
 
::*'''[[dev-urandom|/dev/urandom]]''' -- Same as /dev/random, except it always returns random numbers, even if there is not enough entropy in the system noise available. In the latter case, [[pseudorandom numbers]] are generated, which are based on an algorithm, depending on the type of Unix system.  


::*'''[[dev-urandom|/dev/urandom]]''' -- Same as /dev/random, except it always a pseudorandom number.
<br>
:* '''/home''' -- contains the home directories for the users.  On some Unices, this is under /usr/home
:* '''/home''' -- contains the home directories for the users.  On some Unices, this is under /usr/home
:* '''/include'''
 
:* '''/lib'''  
:* '''/mnt''' -- This is the default location to mount external devices like hard disk drives, pen drives etc.
 
:* '''/lib''' -- This is the depository of all integral UNIX system libraries.
 
:* '''/root''' -- the home directory for the [[superuser]] root.
:* '''/root''' -- the home directory for the [[superuser]] root.
:* '''/tmp''' -- a place for temporary files.  Many Unices clear this directory upon start up.
:* '''/tmp''' -- a place for temporary files.  Many Unices clear this directory upon start up.
:* '''/usr'''
:** '''/usr/bin'''
:** '''/usr/include'''
:** '''/usr/lib'''
:* '''/var''' -- short for "variable."  A place for files that may change often, such as the storage to a database, or the contents of a database.


[[Category:CZ Live]][[Category:Computers Workgroup]]
:* '''/usr''' -- originally the directory holding user home directories, its use has changed, and it now holds executables, libraries, and shared resources that are not system critical: X11, KDE, PERL, etc. (The name "Unix System Resources" is a ''post hoc'' [[backronym]].)
 
::* '''/usr/bin''' -- This directory stores the executables that live in /usr.
 
::* '''/usr/include''' -- /usr/include stores the development headers used throughout the system.
 
::* '''/usr/lib''' -- The required libraries for executables within /usr or elsewhere for that matter, live here.
 
:* '''/var''' -- short for "variable."  A place for files that may change often, such as the storage to a database, the contents of a database, log files (usually stored in ''/var/log''), email stored on a server, etc.
 
::* '''/var/log/''' -- Storage for the system log files.
 
::* '''/var/mail/''' -- the place where all the incoming mails are stored. The user can access his/her own mail only unless he/she has admin rights.
 
::* '''/var/spool/''' -- contains print jobs, mail spools and various other tasks that have been queued , waiting for some related task to finish.
 
==References==
<references/>
 
[[Category:Suggestion Bot Tag]]

Latest revision as of 17:00, 3 November 2024

This article is a stub and thus not approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
This editable Main Article is under development and subject to a disclaimer.

In computer science, and particularly in Unix-like operating systems, the Unix directory structure is a convention of organization.

There are attempts at creating an "official" standard Unix filesystem layout, such as the "Filesystem Hierarchy Standard."[1] Also as part of the "Linux Standards Base" a common filesystem layout is defined, to encourage interoperability among different Linux distributions.[2]

What follows is a generalized overview of common locations of files in a Unix system:

  • / (root) -- The / notes the "root" of the filesystem, where the entire system is contained. Unlike Microsoft Windows, where each drive has its own root directory named by a letter, such as C:\ or F:\, Unix holds the entire system in this single top-level directory, including each device and document. Thus, it is commonly said that in Unix, "everything is a file." Note that Unix uses the forward slash ( / ) rather than the backslash ( \ ) commonly used in Windows.
  • /bin -- Stands for "binaries"; Contains some fundamental utilities needed by a system administrator. As a failsafe, these were placed in a separate directory so that they could be placed on a separate disk or disk partition in case the main drive failed.
  • /etc -- Contains configuration files and some system databases.
  • /dev -- short for devices. Contains file representations of every peripheral device attached to the system.
  • /dev/null -- Also known as the "bit bucket" or "black hole", this virtual file discards all contents written to it. This is typically used to throw away unwanted data streams, such as log files.
  • /dev/random -- This is a virtual file which contains random numbers (subject to the limitations of Random Number Generators in Computing). It uses system noise to generate random numbers and blocks if not enough entropy in the noise is available. Random is commonly used more by programs that absolutely need high quality random data (such as SSH to generate an encryption key).
  • /dev/urandom -- Same as /dev/random, except it always returns random numbers, even if there is not enough entropy in the system noise available. In the latter case, pseudorandom numbers are generated, which are based on an algorithm, depending on the type of Unix system.
  • /home -- contains the home directories for the users. On some Unices, this is under /usr/home
  • /mnt -- This is the default location to mount external devices like hard disk drives, pen drives etc.
  • /lib -- This is the depository of all integral UNIX system libraries.
  • /root -- the home directory for the superuser root.
  • /tmp -- a place for temporary files. Many Unices clear this directory upon start up.
  • /usr -- originally the directory holding user home directories, its use has changed, and it now holds executables, libraries, and shared resources that are not system critical: X11, KDE, PERL, etc. (The name "Unix System Resources" is a post hoc backronym.)
  • /usr/bin -- This directory stores the executables that live in /usr.
  • /usr/include -- /usr/include stores the development headers used throughout the system.
  • /usr/lib -- The required libraries for executables within /usr or elsewhere for that matter, live here.
  • /var -- short for "variable." A place for files that may change often, such as the storage to a database, the contents of a database, log files (usually stored in /var/log), email stored on a server, etc.
  • /var/log/ -- Storage for the system log files.
  • /var/mail/ -- the place where all the incoming mails are stored. The user can access his/her own mail only unless he/she has admin rights.
  • /var/spool/ -- contains print jobs, mail spools and various other tasks that have been queued , waiting for some related task to finish.

References

  1. Filesystem Hierarchy Standard. Retrieved on 2007-07-25.
  2. Linux Standards Base. Retrieved on 2007-07-25.