Online Linux Terminal Logo
OnlineLinuxTerminal
Opérations sur les fichiersCLI Manual

$mkdir

Create new directories and folder hierarchies.

Syntaxe de la commandePOSIX Standard
mkdir [OPTIONS] DIRECTORY...
Communauté Linux2.4k En ligne

Échangez avec des utilisateurs Linux, apprenez des commandes et téléchargez des PDF.

Essayer en direct dans le bac à sable interactif

Simulation côté client sans installation avec retour instantané.

Ouvrir dans le terminal plein écran ↗
bash — terminal

Aperçu et fonctionnement

`mkdir` (Make Directory) creates one or more new directories in the file system. With the `-p` (parents) flag, it can create complete nested directory paths in a single command without throwing errors if intermediate folders already exist.

Options et drapeaux courants

Flag / OptionDescription
-p, --parentsCreate intermediate parent directories as needed without error if existing.
-m, --mode=MODESet file permission mode for new directories upon creation (e.g., -m 700).
-v, --verbosePrint a confirmation message for every created directory.

Exemples pratiques du monde réel

#1Create nested directory hierarchy in one step
mkdir -p /home/user/workspace/src/components && ls -R /home/user/workspace

Creates workspace, src, and components directories automatically.