mkdir Command Purpose Creates one or more new directories. Syntax mkdir [ -m Mode ] [ -p ] Directory ... Description The mkdir command creates one or more new directories specified by the Directory parameter. Each new directory contains the stan- dard entries . (dot) and .. (dot-dot). You can specify the per- missions for the new directories with the -m Mode flag. You can use the umask subroutine to set the default mode for the mkdir command. Note: To make a new directory you must have write permission in the parent directory. Flags -m Mode Sets the permission bits for the newly created direc- tories to the value specified by the Mode variable. The Mode variable takes the same values as the Mode parameter for the chmod command. -p Creates missing intermediate path-name directories. If the -p flag is not specified, the parent directory of each newly created directory must already exist. Exit Status This command returns the following exit values: 0 All the specified directories were created successfully, or the -p option was specified and all the specified directories now ex- ist. >0 An error occurred. Examples 1. To create a new directory called Test in the current working directory with default permissions, enter: mkdir Test 2. To create a new directory called Test with rwxr-xr-x permis- sions in the previously created /home/demo/sub1 directory, enter: mkdir -m 755 /home/demo/sub1/Test 3. To create a new directory called Test with default permissions in the /home/demo/sub2 directory, enter: mkdir -p /home/demo/sub2/Test The -p flag creates the /home, /home/demo, and /home/demo/sub2 directories if they do not already exist. Implementation Specifics This command is part of Base Operating System (BOS) Runtime. Files /usr/bin/mkdir Contains the mkdir command. Related Information The chmod command, rm command. The mkdir subroutine, umask subroutine. Directory Overview in AIX Version 3.2 System User's Guide: Operating System and Devices. Understanding File and Directory Access Modes in AIX Version 3.2 System Management Guide: Operating System and Devices. Shells Overview in AIX Version 3.2 System User's Guide: Operat- ing System and Devices.