Directory Structure

Directories are hierarchical - directory structural organization resembles a tree, with a single root that branches off into related groups of content.

Hierarchy

The top-most directory is considered the root directory. Whatever current “folder” you are in can be viewed as the active directory, and any directories inside that current directory are called subdirectories.

Directory Tree
./root/
└──  directory/ current
    └──  subdirectory/
        └──  file.txt

Note The root directory in our trees will be shortened to . from here on out.

Relationships

The web also uses familial terms to describe content relationships, such as “grandparent,” “parent,” and “child.” Let’s see how this applies to directories:

Immediate

Directory Tree
.
└──  my-site/ parent to
└── content/ child of
└── images/ └── logo.png

In this example, content/ is a subdirectory of the my-site/ directory, also referred to as a “child” of that directory (i.e., child directory).

The reverse also applies; content/, my-site/ is the parent directory to content/.

This hierarchy also describes the location of the files. The file logo.png is located in its parent directory, images/.

Directory Tree
.
└──  my-site/
    └──  content/
        └──  images/ parent directory
└── logo.png

Extended

This familial titling can go deeper as well.

Directory Tree
.
└──  my-site/ grandparent to
└── content/ └── images/ grandchild of
└── logo.png

Here, images/ is the grandchild directory of my-site/, which is images/’s grandparent directory.

This process can extend to great-grandmember, great-great-grandmember, and so forth.


development directory file folder name