create a new directory 

Command, KornShell Built-in


mkdir [-p] [-m mode] directory...


The mkdir command creates a new directory for each named directory argument.


-m mode 

lets you specify permissions for the directories. The mode argument may have the same value as the mode for chmod; see chmod for more details.


creates intermediate directory components that don't already exist. For example, if one of the directory arguments is dir/subdir/subsub and subdir doesn't already exist, mkdir creates it. Directories are created with the mode u+wx, which means read, write and search permissions for the owner.


Possible exit status values are:


Successful completion.


Failure due to any of the following:

— missing mode after -m
— invalid mode
— invalid command line option
— missing directory name
— inability to create the directory

Path not found 

means that the preceding structure (parent directory) of the named directory does not exist.

Access denied 

means that the requested directory already exists or is otherwise inaccessible.

Cannot create directory 

means that some other error occurred during creation of the directory.


mkdir is provided as both an external utility and a built-in MKS KornShell utility.


POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems. Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.

A command of the same name is supplied with Windows. We provide this PTC MKS Toolkit command as an alternative because it accepts multiple names and UNIX-style file names.


PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


rm, rmdir, sh

PTC MKS Toolkit 10.4 Documentation Build 39.