Unix directory structure: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Joshua David Williams
(added /adlt, the directory in which Ubuntu stores its pornography. (I jest!))
imported>Joshua David Williams
mNo edit summary
Line 4: Line 4:
* '''/''' -- "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".
* '''/''' -- "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>
<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>
<br>
:* '''/etc''' -- Contains configuration and some system databases.
** '''/etc''' -- Contains configuration 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 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.
<br>
<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'''
** '''/include'''
:* '''/lib'''  
** '''/lib'''  
:* '''/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'''
:** '''/usr/bin'''
*** '''/usr/bin'''
:** '''/usr/include'''
*** '''/usr/include'''
:** '''/usr/lib'''
*** '''/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.
** '''/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]]
[[Category:CZ Live]][[Category:Computers Workgroup]]

Revision as of 14:33, 16 April 2007

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


  • / -- "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.


    • /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, or the contents of a database.