File system

Directories and subdirectories

Directories are sometimes called folders.

A directory is a special kind of file that contains other files.

A directory can itself contain other directories, which (in the context of that directory) are called subdirectories. The directory is called the parent of its subdirectories.

Each directory can have at most one parent; it can only ever be in one directory1. The consequence of this is that directory structures are hierarchical: they can be represented as (inverted) tree-like graphs:


Click or tap on the directories above to see their parents and subdirectories.

Note how every directory (except one) has only one parent, and can have none, one, or many subdirectories.

1 You can create symbolic links that make it look as if a directory is in more than one place... but these are just aliases, so the directory itself still has only one parent.