Skip to main content
LESSON 2 of 5//File Operations

Creating directories with mkdir

The mkdir (make directory) command creates new folders. The -p flag is particularly powerful — it creates any missing parent directories in the path.

Creating directorieszsh // interactive
~mkdir my-project
# Create nested directories with -p
~mkdir -p my-project/src/components/ui
# Without -p, this would fail if parents don't exist
~mkdir deep/nested/path
mkdir: deep/nested: No such file or directory
PRACTICE//Try the commands from this lesson
INTERACTIVE_TERMINAL//sandbox
Practice terminal — try the commands from this lesson!
Type 'help' for available commands. Tab completion not available in simulator.
Try: