Skip to content

The mkdir command

Make directories. Creates each directory you name. Without -p, the parent directory must already exist.

Usage

mkdir [OPTION]... DIRECTORY...

Options

-p, --parentsmake any missing parent directories too, and don’t complain if the directory exists
-v, --verboseprint a line for each directory made

Examples

  • mkdir musicOne new folder
  • mkdir -p notes/2026/octoberA folder and the ones above it

Learn it step by step

learner@sandbox: ~bash (practice)
Note: Try mkdir here: your home directory has sample files. Press Try beside an example, or type your own.

A practice shell in your browser that behaves like bash on Linux for these commands. Nothing you type leaves the page.