What are directories?



Last revision August 3, 2004

Table of Contents:
  1. The Unix file system
  2. The directory tree
  3. File ownership and permissions
  4. Files as units
  5. Examining file contents
  6. Other commands
  7. Standard Files and Data Pipes

Directories are special files whose contents are a list of names of other files and their matching inodes. A directory can refer to the same inode by multiple links or names (more than one entry for this inode in the list).

Directories can contain names of other directories - this creates the tree structure (which really looks more like the roots than the branches).

There are two special names in each directory list: self, called . (dot), and parent, called .. (dot dot). Like any other file, a directory file cannot know its own name, so it uses the . symbolic name to refer to itself. Also, in order to maintain the one-way hierarchical directory structure, directories do not know the name of their parent, so they use the .. symbolic name to refer to the parent.

The top of the directory tree is the root directory. Because no file (including a directory) can know its own name, the root directory has no name but is referred to simply with a single slash (/).

When referring to a specific file or directory in the tree, we use the concept of a pathname - list of directories, starting at root, separated by slashes.

The file system tree structure can span several physical disks, which look like one single disk to the user. Each physical disk actually has its own tree structure with its own root directory. The root of one physical disk is associated (mounted) by the operating system with a directory name on another disk to hierarchically connect the disks.

See the page on the pangea file system for a description of the specific directory naming system used on pangea.

<--Previous Overview Next-->

Comments or Questions?