O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

mkdir — stdin  stdout  - file  -- opt  --help  --version

Synopsis

mkdir [options] directories

mkdir creates one or more directories:

$ mkdir directory1 directory2 directory3

Useful options

-p

Given a directory path (not just a simple directory name), create any necessary parent directories automatically: mkdir -p /one/two/three creates /one and /one/two if they don’t already exist, then /one/two/three.

-m mode

Create the directory with the given permissions:

$ mkdir -m 0755 mydir

By default, your shell’s umask controls the permissions. See the chmod command in File Properties, and File Protections.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required