Terminal Dojo
Help العربية Sign inGet started

Command library / mkdir

mkdir

BashDraft — pending expert review4 practice missions

Create a new directory

Creates one or more directories. -p is the one you'll use constantly: it creates every missing parent directory in a path at once, and — unlike a bare mkdir — doesn't error if the directory already exists. -v makes it report every directory it actually creates.

Practice mkdir

Usage

mkdir [-p] [-v] directory...

Options and flags

Examples

Common mistakes

mkdir logs/2026/09 mkdir -p logs/2026/09

Without -p, mkdir refuses the whole thing if any parent directory in the path is missing — plain mkdir can only create the final, deepest directory.

Related commands

cdls