Mkdir
The mkdir (make directory) command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, Windows and ReactOS, the command is often abbreviated to md . The command is analogous to the Stratus OpenVOS create_dir command. MetaComCo TRIPOS and AmigaDOS provide a similar MakeDir command to create new directories. The numerical computing environments MATLAB and GNU Octave include an mkdir function with similar functionality.
The mkdir (make directory) command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, Windows and ReactOS, the command is often abbreviated to md . The command is analogous to the Stratus OpenVOS create_dir command. MetaComCo TRIPOS and AmigaDOS provide a similar MakeDir command to create new directories. The numerical computing environments MATLAB and GNU Octave include an mkdir function with similar functionality. ==History== In early versions of Unix (4.1BSD and early versions of System V), this command had to be setuid root as the kernel did not have an mkdir syscall. Instead, it made the directory with mknod and linked in the . and .. directory entries manually. The command is available in MS-DOS versions 2 and later. Digital Research DR DOS 6.0 and Datalight ROM-DOS also include an implementation of the and commands. The version of mkdir bundled in GNU coreutils was written by David MacKenzie. It is also available in the open source MS-DOS emulator DOSBox and in KolibriOS. ==Usage== mkdir command Normal usage is as straightforward as follows: mkdir name_of_directory where name_of_directory is the name of the directory one wants to create. When typed as above (i.e. normal usage), the new directory would be created within the current directory. On Unix and Windows (with Command extensions enabled, the default ), multiple directories can be specified, and mkdir will try to create all of them. ===Options=== On Unix-like operating systems, mkdir takes options. The options are: -p (--parents) : parents or path, will also create all directories leading up to the given directory that do not exist already. For example, mkdir -p a/b will create directory a if it doesn't exist, then will create directory b inside directory a . If the given directory already exists, ignore the error. -m (--mode) : mode, specify the octal permissions of directories created by mkdir . -p is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts. ===Examples=== An example of -p in action is: mkdir -p /tmp/a/b/c If /tmp/a exists but /tmp/a/b does not, mkdir will create /tmp/a/b before creating /tmp/a/b/c . And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself): mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags} If one is using variables with mkdir in a bash script, POSIX `special' built-in command 'eval' would serve its purpose. DOMAIN_NAME=includes,docs eval "mkdir -p tmpdir/{trunk/sources/{${DOMAIN_NAME}},branches,tags}" This will create: tmpdir ________|______ | | | branches tags trunk | sources ____|_____ | | includes docs ==See also== Filesystem Hierarchy Standard GNU Core Utilities Find – The find command coupled with mkdir can be used to only recreate a directory structure (without files). List of Unix commands List of DOS commands ==References== ==Further reading== ==External links== Microsoft TechNet Mkdir article
References
- Users guide · retrieved 2019-10-21 · rev 1352491760
Cite this reference
MLA "Users guide." "Users guide" (PDF). 2019-10-21. https://web.archive.org/web/20190925131719/http://bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf. Accessed 24 November 2026.
Chicago "Users guide." "Users guide" (PDF). 2019-10-21. https://web.archive.org/web/20190925131719/http://bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf.
APA "Users guide" (PDF). (2019). Users guide. Retrieved November 24, 2026, from https://web.archive.org/web/20190925131719/http://bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf
- Datalight ROM-DOS User's Guide · retrieved 2020-09-13 · rev 1352491760
Cite this reference
MLA "Datalight ROM-DOS User's Guide." "Datalight ROM-DOS User's Guide" (PDF). 2020-09-13. https://www.datalight.com/assets/files/ROM-DOS_Users_Guide.pdf. Accessed 24 November 2026.
Chicago "Datalight ROM-DOS User's Guide." "Datalight ROM-DOS User's Guide" (PDF). 2020-09-13. https://www.datalight.com/assets/files/ROM-DOS_Users_Guide.pdf.
APA "Datalight ROM-DOS User's Guide" (PDF). (2020). Datalight ROM-DOS User's Guide. Retrieved November 24, 2026, from https://www.datalight.com/assets/files/ROM-DOS_Users_Guide.pdf
- mkdir(1): make directories - Linux man page · retrieved 2019-01-18 · rev 1352491760
Cite this reference
MLA "mkdir(1): make directories - Linux man page." 2019-01-18. https://linux.die.net/man/1/mkdir. Accessed 24 November 2026.
Chicago "mkdir(1): make directories - Linux man page." 2019-01-18. https://linux.die.net/man/1/mkdir.
APA encyclopegia.org. (2019). mkdir(1): make directories - Linux man page. Retrieved November 24, 2026, from https://linux.die.net/man/1/mkdir
- Shell - KolibriOS wiki · retrieved 2019-08-10 · rev 1352491760
Cite this reference
MLA "Shell - KolibriOS wiki." 2019-08-10. http://wiki.kolibrios.org/wiki/Shell. Accessed 24 November 2026.
Chicago "Shell - KolibriOS wiki." 2019-08-10. http://wiki.kolibrios.org/wiki/Shell.
APA encyclopegia.org. (2019). Shell - KolibriOS wiki. Retrieved November 24, 2026, from http://wiki.kolibrios.org/wiki/Shell
- Microsoft Windows XP - Mkdir · retrieved 2026-11-18 · rev 1352491760
Cite this reference
MLA "Microsoft Windows XP - Mkdir." 2026-11-18. https://web.archive.org/web/20160722020802/http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/mkdir.mspx?mfr=true. Accessed 24 November 2026.
Chicago "Microsoft Windows XP - Mkdir." 2026-11-18. https://web.archive.org/web/20160722020802/http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/mkdir.mspx?mfr=true.
APA encyclopegia.org. (2026). Microsoft Windows XP - Mkdir. Retrieved November 24, 2026, from https://web.archive.org/web/20160722020802/http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/mkdir.mspx?mfr=true
- Microsoft Windows XP - Cmd · retrieved 2026-11-18 · rev 1352491760
Cite this reference
MLA "Microsoft Windows XP - Cmd." 2026-11-18. http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true. Accessed 24 November 2026.
Chicago "Microsoft Windows XP - Cmd." 2026-11-18. http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true.
APA encyclopegia.org. (2026). Microsoft Windows XP - Cmd. Retrieved November 24, 2026, from http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true
- JaTomes Help - OS/2 Commands · retrieved 2019-07-22 · rev 1352491760
Cite this reference
MLA "JaTomes Help - OS/2 Commands." 2019-07-22. https://web.archive.org/web/20190414130029/http://www.jatomes.com/Help/Os2Cmd.php#MD. Accessed 24 November 2026.
Chicago "JaTomes Help - OS/2 Commands." 2019-07-22. https://web.archive.org/web/20190414130029/http://www.jatomes.com/Help/Os2Cmd.php#MD.
APA encyclopegia.org. (2019). JaTomes Help - OS/2 Commands. Retrieved November 24, 2026, from https://web.archive.org/web/20190414130029/http://www.jatomes.com/Help/Os2Cmd.php#MD
- GitHub - reactos/reactos: A free Windows-compatible Operating System · retrieved 2026-11-18 · rev 1352491760
Cite this reference
MLA "GitHub - reactos/reactos: A free Windows-compatible Operating System." 2026-11-18. https://github.com/reactos/reactos. Accessed 24 November 2026.
Chicago "GitHub - reactos/reactos: A free Windows-compatible Operating System." 2026-11-18. https://github.com/reactos/reactos.
APA encyclopegia.org. (2026). GitHub - reactos/reactos: A free Windows-compatible Operating System. Retrieved November 24, 2026, from https://github.com/reactos/reactos
- Reference manual · retrieved 2019-10-21 · rev 1352491760
Cite this reference
MLA "Reference manual." "Reference manual" (PDF). 2019-10-21. http://stratadoc.stratus.com/vos/19.1.0/r098-19/wwhelp/wwhimpl/common/html/r098-19.pdf. Accessed 24 November 2026.
Chicago "Reference manual." "Reference manual" (PDF). 2019-10-21. http://stratadoc.stratus.com/vos/19.1.0/r098-19/wwhelp/wwhimpl/common/html/r098-19.pdf.
APA "Reference manual" (PDF). (2019). Reference manual. Retrieved November 24, 2026, from http://stratadoc.stratus.com/vos/19.1.0/r098-19/wwhelp/wwhimpl/common/html/r098-19.pdf
- Introduction to Tripos · retrieved 2019-10-21 · rev 1352491760
Cite this reference
MLA "Introduction to Tripos." "Introduction to Tripos" (PDF). 2019-10-21. https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf. Accessed 24 November 2026.
Chicago "Introduction to Tripos." "Introduction to Tripos" (PDF). 2019-10-21. https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf.
APA "Introduction to Tripos" (PDF). (2019). Introduction to Tripos. Retrieved November 24, 2026, from https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf
- Rügheimer, Hannes; Spanik, Christian (October 22, 1988). AmigaDOS quick reference . Grand Rapids, Mi : Abacus. ISBN 9781557550491 – via Internet Archive. Wikipedia revision 1352491760, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1352491760
Cite this reference
MLA "Rügheimer, Hannes; Spanik, Christian (October 22, 1988). AmigaDOS quick reference . Grand Rapids, Mi : Abacus. ISBN 9781557550491 – via Internet Archive. Wikipedia revision 1352491760, retrieved 2026-11-19." Rügheimer, Hannes; Spanik, Christian (October 22, 1988). 2026-11-18. http://archive.org/details/1988-rugheimer-spanik-amigados-quick-reference. Accessed 24 November 2026.
Chicago "Rügheimer, Hannes; Spanik, Christian (October 22, 1988). AmigaDOS quick reference . Grand Rapids, Mi : Abacus. ISBN 9781557550491 – via Internet Archive. Wikipedia revision 1352491760, retrieved 2026-11-19." Rügheimer, Hannes; Spanik, Christian (October 22, 1988). 2026-11-18. http://archive.org/details/1988-rugheimer-spanik-amigados-quick-reference.
APA Rügheimer, Hannes; Spanik, Christian (October 22, 1988). (2026). Rügheimer, Hannes; Spanik, Christian (October 22, 1988). AmigaDOS quick reference . Grand Rapids, Mi : Abacus. ISBN 9781557550491 – via Internet Archive. Wikipedia revision 1352491760, retrieved 2026-11-19. Retrieved November 24, 2026, from http://archive.org/details/1988-rugheimer-spanik-amigados-quick-reference
- Make new folder - MATLAB mkdir · retrieved 2019-04-05 · rev 1352491760
Cite this reference
MLA "Make new folder - MATLAB mkdir." 2019-04-05. https://www.mathworks.com/help/matlab/ref/mkdir.html. Accessed 24 November 2026.
Chicago "Make new folder - MATLAB mkdir." 2019-04-05. https://www.mathworks.com/help/matlab/ref/mkdir.html.
APA encyclopegia.org. (2019). Make new folder - MATLAB mkdir. Retrieved November 24, 2026, from https://www.mathworks.com/help/matlab/ref/mkdir.html
- Function Reference: mkdir · retrieved 2026-11-18 · rev 1352491760
Cite this reference
MLA "Function Reference: mkdir." 2026-11-18. https://octave.sourceforge.io/octave/function/mkdir.html. Accessed 24 November 2026.
Chicago "Function Reference: mkdir." 2026-11-18. https://octave.sourceforge.io/octave/function/mkdir.html.
APA encyclopegia.org. (2026). Function Reference: mkdir. Retrieved November 24, 2026, from https://octave.sourceforge.io/octave/function/mkdir.html
- EFI Shells and Scripting · retrieved 2013-09-24 · rev 1352491760
Cite this reference
MLA "EFI Shells and Scripting." 2013-09-24. http://software.intel.com/en-us/articles/efi-shells-and-scripting/. Accessed 24 November 2026.
Chicago "EFI Shells and Scripting." 2013-09-24. http://software.intel.com/en-us/articles/efi-shells-and-scripting/.
APA encyclopegia.org. (2013). EFI Shells and Scripting. Retrieved November 24, 2026, from http://software.intel.com/en-us/articles/efi-shells-and-scripting/
- Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition . Microsoft Press . ISBN 0-7356-1812-7 . Wikipedia revision 1352491760, retrieved 2026-11-19 · retrieved 2026-11-18 · rev 1352491760
Cite this reference
MLA "Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition . Microsoft Press . ISBN 0-7356-1812-7 . Wikipedia revision 1352491760, retrieved 2026-11-19." Wolverton, Van (2003). 2026-11-18. https://en.wikipedia.org/wiki/Microsoft_Press. Accessed 24 November 2026.
Chicago "Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition . Microsoft Press . ISBN 0-7356-1812-7 . Wikipedia revision 1352491760, retrieved 2026-11-19." Wolverton, Van (2003). 2026-11-18. https://en.wikipedia.org/wiki/Microsoft_Press.
APA Wolverton, Van (2003). (2026). Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition . Microsoft Press . ISBN 0-7356-1812-7 . Wikipedia revision 1352491760, retrieved 2026-11-19. Retrieved November 24, 2026, from https://en.wikipedia.org/wiki/Microsoft_Press
- DR DOS 6.0 User Guide Optimisation and Configuration Tips · retrieved 2019-08-12 · rev 1352491760
Cite this reference
MLA "DR DOS 6.0 User Guide Optimisation and Configuration Tips." "DR DOS 6. 2019-08-12. https://web.archive.org/web/20190930135943/http://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf. Accessed 24 November 2026.
Chicago "DR DOS 6.0 User Guide Optimisation and Configuration Tips." "DR DOS 6. 2019-08-12. https://web.archive.org/web/20190930135943/http://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf.
APA "DR DOS 6. (2019). DR DOS 6.0 User Guide Optimisation and Configuration Tips. Retrieved November 24, 2026, from https://web.archive.org/web/20190930135943/http://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf
Cite this article
MLA
"Mkdir." encyclopegia.org, 2026, https://encyclopegia.org/wiki/mkdir. Accessed 24 November 2026.
Chicago
"Mkdir." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/mkdir.
APA
encyclopegia.org. (2026). Mkdir. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/mkdir
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON