{"id":9006,"date":"2026-05-30T02:00:04","date_gmt":"2026-05-30T00:00:04","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=9006"},"modified":"2026-05-30T02:00:05","modified_gmt":"2026-05-30T00:00:05","slug":"comenzi-ssh-mkdir","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-mkdir\/","title":{"rendered":"Comenzi SSH - mkdir"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">In server administration, backend web development, and cloud systems engineering, structuring your file system to organize files, isolate components, or set up new website environments is a fundamental task. The <strong><code>mkdir<\/code><\/strong> command stands for <strong>Make Directory<\/strong>. It is a core POSIX-standard terminal utility used explicitly to create new, empty folders within your server&#8217;s filesystem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Using this command lets you build clean directory architectures for your projects instantly without needing a visual file manager.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-mkdir\/#Direct_Folder_Creation_and_Primary_Command_Flags\" >Direct Folder Creation and Primary Command Flags<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-mkdir\/#1_Building_Nested_Parent_Paths_Automatically_mkdir_-p\" >1. Building Nested Parent Paths Automatically (mkdir -p)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-mkdir\/#2_Confirming_Creations_with_Verbose_Mode_mkdir_-v\" >2. Confirming Creations with Verbose Mode (mkdir -v)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-mkdir\/#3_Hardcoding_Initial_Access_Permissions_mkdir_-m\" >3. Hardcoding Initial Access Permissions (mkdir -m)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-mkdir\/#Working_with_Absolute_Brand_Directory_Paths\" >Working with Absolute Brand Directory Paths<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-mkdir\/#Structuring_a_New_Testing_Target_In-Place\" >Structuring a New Testing Target In-Place<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/ssh-commands-mkdir\/#Deploying_a_Staging_Folder_via_Absolute_Pathing\" >Deploying a Staging Folder via Absolute Pathing<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Direct_Folder_Creation_and_Primary_Command_Flags\"><\/span>Direct Folder Creation and Primary Command Flags<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<\/div>\n\n<div id=\"mybox-80426898\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Acces timpuriu<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Mai ave\u021bi nevoie de ajutor?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contacta\u021bi echipa noastr\u0103 de servicii pentru clien\u021bi.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Trimite mesaj<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">The basic syntax for creating a directory requires passing the command followed by your desired folder name: <code>mkdir new_folder<\/code>. To handle nested subfolders, track creation events, or set explicit folder access rules, you will regularly append these core operational flags:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Building_Nested_Parent_Paths_Automatically_mkdir_-p\"><\/span>1. Building Nested Parent Paths Automatically (<code>mkdir -p<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By default, if you try to create a deeply nested folder path (such as <code>modules\/assets\/images<\/code>) when the top folders do not exist yet, the standard <code>mkdir<\/code> command will fail and throw a &#8220;No such file or directory&#8221; error. The <code>-p<\/code> (parents) flag fixes this by automatically creating all missing parent directories along the path.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Action:<\/strong> Run the parents flag followed by your complete desired nested path:<code>mkdir -p modules\/assets\/images<\/code><\/li>\n\n\n\n<li><strong>Operational Benefit:<\/strong> This is the most efficient way to set up complete, multi-tiered directory structures for a new website feature or plugin layout in a single keystroke. It also skips throwing an error if the directory path already exists.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Confirming_Creations_with_Verbose_Mode_mkdir_-v\"><\/span>2. Confirming Creations with Verbose Mode (<code>mkdir -v<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By default, when <code>mkdir<\/code> executes successfully, the terminal remains completely silent and simply displays a fresh command prompt line. The <code>-v<\/code> (verbose) flag forces the server to output a live confirmation message detailing every directory it creates.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Action:<\/strong> Combine the verbose flag with the parents flag to monitor structural setups:<code>mkdir -pv custom-plugin\/includes\/css<\/code><\/li>\n\n\n\n<li><strong>The Output Returned:<\/strong> The terminal will print a clear step-by-step log of its actions:<code>mkdir: created directory 'custom-plugin' mkdir: created directory 'custom-plugin\/includes' mkdir: created directory 'custom-plugin\/includes\/css'<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Hardcoding_Initial_Access_Permissions_mkdir_-m\"><\/span>3. Hardcoding Initial Access Permissions (<code>mkdir -m<\/code>)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When you create a folder normally, the server automatically applies default system permissions (usually <code>755<\/code> or <code>775<\/code>). The <code>-m<\/code> (mode) flag allows you to set explicit file system permission bits right at the moment of creation.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Action:<\/strong> Pass the exact octal configuration value alongside your target folder name:<code>mkdir -m 700 secure_vault<\/code><\/li>\n\n\n\n<li><strong>Operational Benefit:<\/strong> This instantly locks down highly sensitive paths\u2014such as folders meant for private cryptographic keys or internal database backups\u2014ensuring only your specific user account can read or write data there.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Working_with_Absolute_Brand_Directory_Paths\"><\/span>Working with Absolute Brand Directory Paths<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can provision folder frameworks anywhere in your server account by leveraging absolute paths. When setting up directories inside your brand layout, ensure your paths are mapped cleanly from your home root:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Structuring_a_New_Testing_Target_In-Place\"><\/span>Structuring a New Testing Target In-Place<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To add a dedicated temporary log folder inside your primary website directory, execute a direct relative path command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir public_html\/temp_logs\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Deploying_a_Staging_Folder_via_Absolute_Pathing\"><\/span>Deploying a Staging Folder via Absolute Pathing<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To build a clean staging directory branch for an independent domain name within your brand environment, use explicit absolute targeting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/home\/mybox\/yourlogin\/yourwebsite.com\/public_html\/staging-v2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[54],"manual_kb_tag":[6198,6199,6200,1180,1494,1495,1513,6174,6175,6197],"class_list":["post-9006","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-ssh","manual_kb_tag-make-directory","manual_kb_tag-create-directory","manual_kb_tag-nested-directories","manual_kb_tag-server-administration","manual_kb_tag-directory-creation","manual_kb_tag-mkdir-command","manual_kb_tag-mkdir","manual_kb_tag-backend-web-development","manual_kb_tag-cloud-systems-engineering","manual_kb_tag-file-system"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9006\/revisions"}],"predecessor-version":[{"id":9007,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9006\/revisions\/9007"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=9006"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=9006"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=9006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}