mkdir -- make directories
mkdir [-p] [-m mode] directory_name ...
mkdir creates the directories names as operands, in the order specified, using
mode rwxrwxrwx (0777) as modified by the current umask.
mkdir accepts the following options:
- -m
-
Set the file permission bits of the final created directory to the
specified mode. The mode argument can be in any of the formats specified to
the chmod utility, though they are not all implemented. (See BUGS.) If a symbolic mode is specified, the operation characters ``+'' and
``-'' are interpreted relative to an initial mode of ``a=rwx''.
- -p
-
Create intermediate directories as required. If this option is not
specified, the full path prefix of each operand must already exist.
Intermediate directories are created with permission bits of rwxrwxrwx
(0777) as modified by the current umask, plus write and search permission
for the owner. Do not consider it an error if the argument directory
already exists.
The user must have write permission in the parent directory.
mkdir exits 0 if successful, and >0 if an error occurred.
The mode used by mkdir in creating directories is affected by the umask.
mkdir depends on the underlying Perl mkdir function. On systems without proper
support for mode setting, or without POSIX modes, it does not set the modes
specified.
This mkdir implementation is modelled on the OpenBSD and NetBSD
variants. It accepts permission options, as they do, which it does not
implement: specifically it ignores the set user id, set group id, and
sticky bit flags. mkdir collapses the ``X'' and ``x'' options.
This mkdir implementation is compatible with the NetBSD implementation. This implementation has also been based on the OpenBSD manual description. The OpenBSD mkdir implementation is expected to be compliant with the
IEEE Std1003.2-1992 specification, also known as POSIX.2, so this implementation may be, as well.
The Perl implementation of mkdir was written by James Wetterau, Jr.,
jwjr@panix.com.
This program is copyright by James Wetterau, Jr., 1999.
This program is free and open software. You may use, copy, modify,
distribute and sell this program (and any modified variants) in any way you
wish, provided you do not restrict others to do the same.