Beginner Package: coreutils

mkdir

Create a new directory.

Syntax

mkdir [options] directory

Description

mkdir creates one or more new directories. The -p flag additionally creates any missing parent directories in the path and doesn't error if the directory already exists.

Examples

mkdir project
Create a single new directory
mkdir -p project/src/utils
Create a full nested path in one go
mkdir -m 700 private
Create a directory with specific permissions

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux