Skip to content
BENIBIX Learn

Directory

Development🖥️ Platforms & OSFiles and Folders

Also known as Folder, Directories, Subdirectory

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

Think of it like

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

Example

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

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.

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 code

console
$ mkdir site
$ cd site
$ pwd
/home/jack/site
Make a directory, step into it, then print where you are.
Each round box is a directory. home holds emma and jack, and emma holds two files.

Common mistake

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

Key takeaways

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

Learn it properly