Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)

User Commands (m - o) mkdir(1)
NAME
mkdir - Makes a directory
SYNOPSIS
mkdir [-m mode][-p] directory ...
The mkdir command creates new directories with read, write, and execute permissions based
upon the permissions established by the umask setting.
FLAGS
-m mode Sets the file permissions to mode, after creating the specified directory. The mode
argument can be either an absolute mode string or a symbolic mode string as defined
for chmod. In the latter case, use only 9 protection bits in the mode argument, because
the set-user-ID, set-group-ID, and sticky bits are ignored.
In symbolic mode strings, the operation characters + and - are interpreted relative to an
assumed initial mode of a=rwx;A+ adds permissions to the default mode, whereas a -
deletes permissions from the default mode.
-p Creates intermediate directories as necessary; otherwise, the full pathname prefix to
directory must already exist. Note that mkdir requires write permission in the parent
directory for users other than root.
For each directory argument that does not name an existing directory, effects
equivalent to those caused by the following command occur:
mkdir -p -m $(umask -S),u+wx $(dirname directory)&&
mkdir [-m mode] directory
[-m mode] represents the flag supplied to the original invocation of mkdir, if any.
Each component of directory that does not name an existing directory is created with
mode 777, modified by the current file mode creation mask (umask). The equivalent
of chmod u+wx is performed on each component to ensure that mkdir can create
lower directories regardless of the setting of umask.
For systems running G06.30 and later G-series RVUs, each component of directory
that names an existing directory is ignored without error. For systems running other
RVUs, each component of directory that names an existing directory is ignored
without error, except for the last component. If an intermediate pathname component
exists, but permissions are set to prevent writing or searching, mkdir fails and returns
an error message.
The mode argument does not apply to any intermediate directories created when the -p
flag is specified.
DESCRIPTION
The mkdir command also creates the standard entries . (dot), for the directory itself, and .. (dot
dot), for its parent.
The value of the bitwise inclusive OR of S_IRWXU, S_IRWXG, and S_IRWXO is used as the
mode argument. (If the -m flag is specified, the mode argument overrides this default.)
Access Control Lists (ACLs)
If the parent directory has an ACL that contains default ACL entries, the new directory inherits
ACL entries and permissions as described in the acl(5) reference page.
EXAMPLES
1. To create a new directory called test,enter:
mkdir test
527188-021 Hewlett-Packard Company 617