mkdir

Create one or more new directories.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

mkdir creates directories. The -p flag creates all parent directories as needed and suppresses errors if already existing — ideal for idempotent scripts and CI pipelines.

Common flags
FlagMeaning
-p --parentsCreate parent dirs as needed, no error if existing
-m --modeSet permissions for the new directory (like chmod)
-v --verbosePrint a message for each created directory
Examples
mkdir -p /opt/app/{logs,config,data}Create app directory with three subdirectories via brace expansion · explain & risk-check →
mkdir -m 700 /home/user/.sshCreate .ssh directory with strict owner-only permissions · explain & risk-check →
mkdir -pv /var/www/html/static/cssCreate full nested path verbosely · explain & risk-check →
Pro tip

Use brace expansion `mkdir -p project/{src,tests,docs,bin}` to scaffold entire project structures in one command.

Related
rm ls chmod touch
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man mkdir for your version. Test destructive commands on a non-production system first.