Unix directory structure: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Eric M Gearhart
(Added reference section)
imported>Eric M Gearhart
(Fixed a reference, added some more content)
Line 1: Line 1:
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> 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>
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>


What follows is a generalized overview of common locations of files in a Unix system:
What follows is a generalized overview of common locations of files in a Unix system:
Line 16: Line 16:
::*'''[[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 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-urandom|/dev/urandom]]''' -- Same as /dev/random, except it always a pseudorandom number.
::*'''[[dev-urandom|/dev/urandom]]''' -- Same as /dev/random, except it always a pseudorandom number. Urandom is commonly used more by programs that absoultely need truly random data (such as SSH to generate an [[encryption]] key).


:* '''/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

Revision as of 12:46, 25 July 2007

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"; 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".
  • /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 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/urandom -- Same as /dev/random, except it always a pseudorandom number. Urandom is commonly used more by programs that absoultely need truly random data (such as SSH to generate an encryption key).
  • /home -- contains the home directories for the users. On some Unices, this is under /usr/home
  • /include
  • /lib
  • /root -- the home directory for the superuser root.
  • /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, the contents of a database, log files (usually stored in /var/log), email stored on a server, etc.

References

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