File Operations

mkdir

Create new directories with optional parent directory creation.

Synopsis

syntax
mkdir [OPTION]... DIRECTORY...

Examples

Create a single directory
mkdir projects
Create nested directory tree
mkdir -p a/b/c
Create directory with restricted permissions
mkdir -m 700 secrets
Create multiple directories with brace expansion
mkdir -pv src/{components,utils,hooks}

Common options

FlagDescription
-pCreate parent directories as needed
-mSet permission mode (like chmod)
-vPrint each directory created

About mkdir

The `mkdir` command create new directories with optional parent directory creation. File operation commands are essential for navigating and managing the Linux filesystem.

They form the backbone of everyday system administration and development workflows. Mastering these commands enables you to efficiently create, move, copy, and organize files and directories from the terminal, which is often faster and more scriptable than graphical alternatives.

The command accepts 3 commonly used flags shown above, though the full set of options is available in the man page (`man mkdir`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More File Operations Commands

Other commands in the File Operations category

Related tools