{"id":11165,"date":"2021-10-15T11:28:15","date_gmt":"2021-10-15T11:28:15","guid":{"rendered":"https:\/\/linuxways.net\/?p=11165"},"modified":"2021-10-15T11:28:15","modified_gmt":"2021-10-15T11:28:15","slug":"mkdir-command-in-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/mkdir-command-in-linux\/","title":{"rendered":"Mkdir Command in Linux"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>mkdir command stands for make directory allows the user to create an empty directory on Linux operating system. This command can also create multiple folders at once as well as set permissions for folders. Of course, pay attention to the permission to create the user&#8217;s directory when standing in the parent directory or not? Otherwise, you will get an error message about permission denied.<\/p>\n<p>And the article below, we will show you how to use the mkdir command through several examples as go through below.<\/p>\n<h2>The syntax of mkdir command<\/h2>\n<pre>$ mkdir [options] name<\/pre>\n<p>For example, I will create a directory named linuxer:<\/p>\n<pre>$ mkdir linuxer<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1042\" height=\"93\" class=\"wp-image-11166\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-295.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-295.png 1042w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-295-300x27.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-295-1024x91.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-295-768x69.png 768w\" sizes=\"auto, (max-width: 1042px) 100vw, 1042px\" \/><\/p>\n<p><strong>options<\/strong><\/p>\n<p><strong>&#8211;version <\/strong>check your version<\/p>\n<pre>$ mkdir --version<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1041\" height=\"187\" class=\"wp-image-11167\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-296.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-296.png 1041w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-296-300x54.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-296-1024x184.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-296-768x138.png 768w\" sizes=\"auto, (max-width: 1041px) 100vw, 1041px\" \/><\/p>\n<p><strong>&#8211;help <\/strong> display help information<\/p>\n<pre>$ mkdir --help<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1040\" height=\"392\" class=\"wp-image-11168\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-297.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-297.png 1040w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-297-300x113.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-297-1024x386.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-297-768x289.png 768w\" sizes=\"auto, (max-width: 1040px) 100vw, 1040px\" \/><\/p>\n<p><strong>-v <\/strong> show folder creation process<\/p>\n<pre>$ mkdir -v [name]<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1042\" height=\"70\" class=\"wp-image-11169\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-298.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-298.png 1042w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-298-300x20.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-298-1024x69.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-298-768x52.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-298-1020x70.png 1020w\" sizes=\"auto, (max-width: 1042px) 100vw, 1042px\" \/><\/p>\n<p><strong>-p<\/strong> create a directory with parent directory level<\/p>\n<pre>$ mkdir -p [name]<\/pre>\n<p>For example, I will create the linux1 directory inside the linux2 directory:<\/p>\n<pre>$ mkdir -p -v linux1\/linux2<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1043\" height=\"93\" class=\"wp-image-11170\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-299.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-299.png 1043w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-299-300x27.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-299-1024x91.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-299-768x68.png 768w\" sizes=\"auto, (max-width: 1043px) 100vw, 1043px\" \/><\/p>\n<p><strong>-m<\/strong> create folders with specific permissions<\/p>\n<pre>$ mkdir -m [permission_value] name<\/pre>\n<p>For example, I want to create a directory named best with all permission:<\/p>\n<pre>$ mkdir -m a=rwx best<\/pre>\n<h2>Conclusion<\/h2>\n<p>In this tutorial, we guided you on how to use the mkdir command with some examples.<\/p>\n<p>Thanks for reading!<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction mkdir command stands for make directory allows the user to create an empty directory on Linux operating system. This command can also create multiple folders at once&hellip;<\/p>","protected":false},"author":1,"featured_media":11221,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4,5,83,165,2],"tags":[35,631],"class_list":["post-11165","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-debian","category-mint","category-opensuse","category-red-hat","category-ubuntu","tag-linux","tag-mkdir-command"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=11165"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11165\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/11221"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=11165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=11165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=11165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}