Create a new directory.
mkdir newdir
mkdir creates a single new directory at the given path. Errors if any parent in the path is missing - use -p to create parents along the way.
Safety: Preview paths and redirections before changing files or streams.
Create a directory and all missing parent directories.
mkdir -p path/to/nested/dir
-p (parents) creates every missing directory along the path and is idempotent - no error if a level already exists. Without it, mkdir fails the moment it hits a missing parent.
Safety: Preview paths and redirections before changing files or streams.
Build the habit: BashDrill drills mkdir and the rest of the Bash workflow until the safe first move is automatic. Try a Bash drill.