# Directory

> A folder: a place that holds files and other folders. They form a tree.

**Field:** Software Development  
**Category:** Platforms & OS  
**Also known as:** Folder, Directories, Subdirectory

## Think of it like

Think of it like a drawer. A drawer holds papers, and it can hold smaller boxes too.

## Definition

A directory is a place that holds files and other directories. It is the same thing as a folder. The word folder comes from the desktop, and directory from the command line. A directory inside another is a subdirectory. Together they form a tree. The top of the tree is called the root.

## Example

Jack makes a folder for his project with mkdir site. Then he moves into it with cd site and adds his files.

## Example code

```console
$ mkdir site
$ cd site
$ pwd
/home/jack/site
```

Make a directory, step into it, then print where you are.

## Why it matters

Every project is a directory full of files and more directories. Tools find your code by where it sits in that tree.

## Common mistake

Thinking a folder and a directory are different things. They are two names for the same thing.

## Three principles

- **Holds things.** Files and other folders go inside.
- **Makes a tree.** Folders inside folders, down from the root.
- **Two names.** Folder and directory mean the same.

## Related terms

- [File System](https://learn.benibix.com/term/development/file-system)
- [File Path](https://learn.benibix.com/term/development/file-path)
- [Working Directory](https://learn.benibix.com/term/development/working-directory)
- [Command Line](https://learn.benibix.com/term/infrastructure/command-line)

## Taught in

- [File Paths and Folders](https://learn.benibix.com/learn/development-platforms/file-paths-and-folders): OS and Files, 9/10

![A tree of boxes. The root, a slash, holds home and etc. Home holds emma and jack. Emma holds two files, notes.txt and photo.png. The boxes from the root to notes.txt are lit up. Under the tree, the path to that file is written out twice: /home/emma/notes.txt on Linux and macOS, and C:\Users\Emma\notes.txt on Windows.](https://learn.benibix.com/diagrams/dev-file-tree.svg)

---

Source: https://learn.benibix.com/term/development/directory
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
