{"id":1545,"date":"2025-07-04T11:43:10","date_gmt":"2025-07-04T11:43:10","guid":{"rendered":"https:\/\/www.hostingseekers.com\/how-to\/?p=1545"},"modified":"2025-07-07T11:26:45","modified_gmt":"2025-07-07T11:26:45","slug":"how-to-create-and-delete-directory-in-linux","status":"publish","type":"post","link":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/","title":{"rendered":"How to Create &#038; Delete a Directory in Linux"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1546 size-full\" src=\"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395.webp\" alt=\"how to create a directory in linux \" width=\"1200\" height=\"675\" srcset=\"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395.webp 1200w, https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395-300x169.webp 300w, https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395-1024x576.webp 1024w, https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395-768x432.webp 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p>Creating and deleting files and directories in Linux is one of the most fundamental tasks when working with the Linux command line. Whether you are managing and organizing project files, setting up a development environment, or managing system resources, knowing how to create and delete directories is vital for efficient file system navigation.<\/p>\n<p>This guide will help you create and delete a directory on Linux. Let\u2019s get started with how to create and delete a directory in Linux.<\/p>\n<h2>How to Create a Directory?<\/h2>\n<h3>via the mkdir Command<\/h3>\n<p>The mkdir (make directory) command in Linux is a command-line utility that enables users to create new directories<\/p>\n<h3>Prerequisites<\/h3>\n<p>You need a Linux or UNIX-like system. Additionally, you will need access to a terminal or command line, as well as a user with permission to create and modify directory settings.<\/p>\n<h3>mkdir Command Syntax in Linux<\/h3>\n<p>The mkdir command has the following syntax:<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">mkdir [options] dir_name<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p>The [Options] section is optional and modifies the behavior of the mkdir command. The available options<\/p>\n<p>The dir_name is the name or names of the directories you want to create. You can highlight multiple directory names separated by a space.<\/p>\n<h3>mkidr Linux Command Options<\/h3>\n<p>The options enable you to modify the mkdir command\u2019s behavior. The table shows the most common mkdir options and their descriptions:<\/p>\n<table style=\"font-weight: 400;\" data-tablestyle=\"MsoTableGrid\" data-tablelook=\"1696\" aria-rowcount=\"7\">\n<tbody>\n<tr aria-rowindex=\"1\">\n<td data-celllook=\"0\"><b><span data-contrast=\"auto\">Option\u00a0<\/span><\/b><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><b><span data-contrast=\"auto\">Description\u00a0<\/span><\/b><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"2\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">-p<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">It is used to create parent directories if they don\u2019t exist.\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"3\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">-m a=[rwz]\u00a0 [dir_name]<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">It sets the file modes, i.e, permissions for the new directory,\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"4\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">-v or&#8211; verbose<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">It displays a message for each directory created. When utilized with the [directories] argument, it highlights the names of the directories being created.\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"5\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">&#8211;version<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">It is used to display the version number and information about<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"6\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">-help\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">It sets the SELinux security context for directories.\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<\/tr>\n<tr aria-rowindex=\"7\">\n<td data-celllook=\"0\"><span data-contrast=\"auto\">-Z<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<td data-celllook=\"0\"><span data-contrast=\"auto\">It is used to set the SELinux security context for directories.\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Creating a Directory in Linux<\/h2>\n<p>To create a directory using the terminal, pass the desired directory name to the mkdir command.<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">mkdir Linux<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p>If the operation is successful, the terminal returns an empty line. To verify the directory\u2019s creation, use the Is command:<br \/>\nPicture<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1548\" src=\"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Picture-2.webp\" alt=\"mkdir Linux\" width=\"700\" height=\"179\" srcset=\"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Picture-2.webp 570w, https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Picture-2-300x77.webp 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<h2>Creating a Directory in a Specific Location<\/h2>\n<p>To create directories in a particular location other than your current working directory. You need to specify the full directory path.<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">mkdir \/tmp\/example<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p>How to Create Multiple Directories?<br \/>\nWith mkdir, it\u2019s possible to create directories; it can be time-consuming when you need to make more than a few. To avoid that, run a single mkdir command and list the directory names separated by a space.<\/p>\n<p><strong>For example,<\/strong><\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">mkdir dir1 dir2 dir3<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p>The above command creates three particular directories. Also, you can use mkdir with curly brackets {} to create multiple directories. For instance, to create several directories, list them within curly brackets, without spaces:<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">mkdir {test1, test2, test3}<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p>You can also develop and create a batch of directories starting with the same pattern. Prepend the curly brackets with the pattern and use the brackets to specify the number of directories, for example;<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">mkdir dir{1..15}<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<h2>How to Delete a Directory in Linux?<\/h2>\n<p>When removing a directory in Linux, consider whether it is empty or contains files and other directories.<\/p>\n<p>To delete a directory in Linux, there are two commands you can utilize: rmdir to delete empty directories and rm -r to remove directories with files or subdirectories.<\/p>\n<p><strong>Method 1:<\/strong> Use the \u2018rmdir\u2019 command- removing an empty directory.<\/p>\n<p>To remove or delete a directory in Linux, you can use the rmdir command. This command is straight forward and safe because it only enables you to delete empty directories, preventing the accidental deletion of directories with content.<\/p>\n<h4>Syntax<\/h4>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">rmdir [options] [directory name]<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p><strong>Step 1:<\/strong> Check Your Current Directory<\/p>\n<p>Firstly, open your Linux terminal. Now, before deleting the directory, use the &#8216;pwd&#8217; command to determine where you are in the filesystem.<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">pwd<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p><strong>Step 2:<\/strong> Remove the Directory<\/p>\n<p>Now, to delete an existing empty directory, use the rmdir command:<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">rmdir gfg<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p><strong>Step 3:<\/strong> Confirm the directory was deleted<\/p>\n<p>Just write the command to be assured that the directory was deleted:<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">ls<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p><strong>Method 2:<\/strong> Using the rm command to remove a directory<\/p>\n<p>The rm command in Linux is a powerful utility used to delete files and directories. To remove a directory along with its contents, the -r (recursive) option is essential. It ensures that the entire directory and all its contents are permanently deleted.<\/p>\n<h4>Syntax:<\/h4>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">rm [options] [file or directory name]<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p><strong>Step 1:<\/strong> Navigate to Parent Directory<\/p>\n<p>cd \/home\/kali\/Documents\/<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">rm -ri directory_name<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p><strong>Step 2:<\/strong> Remove the Directory<\/p>\n<p>To remove the directory and its contents, use the rm command with the \u2013r (recursive) option.<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">rm -r GeeksforGeeks<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p><strong>Step 3:<\/strong> Optional Confirmation<\/p>\n<p>To confirm each deletion, you can add the \u2018-I&#8217; option to prompt for confirmation.<\/p>\n<div class=\"copy-wrapper\">\n<h5 class=\"copy-tag\">rm -ri directory_name<\/h5>\n<p><button class=\"copyButton\"><i class=\"fa-solid fa-copy\"><\/i><\/button><br \/>\n<span class=\"copy-message\">Copied!<\/span><\/p>\n<\/div>\n<p>By utilizing the rmdir command, we can easily delete a directory on our system. As you can see in the image, initially, when we created the directory, it was in our system. However, after the deletion, it was no longer visible in our file directories, and the file was successfully removed.<\/p>\n<p><strong>Summing Up<\/strong><\/p>\n<p>Managing directories is a fundamental skill for anyone working with the Linux command line. Whether you&#8217;re organizing project files or cleaning up your system, knowing how to create and delete directories efficiently can save you time and keep your workspace organized. With simple commands like mkdir for creating directories and rm -r or rmdir for deleting them, you have complete control over your file system. As always, exercise caution\u2014especially when using rm -r\u2014to avoid accidentally deleting essential data<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating and deleting files and directories in Linux is one of the most fundamental tasks when working with the Linux command line. Whether you are managing and organizing project files, setting up a development environment, or managing system resources, knowing how to create and delete directories is vital for efficient file system navigation. This guide [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1546,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1545","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create &amp; Delete a Directory in Linux<\/title>\n<meta name=\"description\" content=\"Learn step-by-step how to create and delete directories in Linux using simple commands. Perfect for beginners and system administrators looking to manage files efficiently.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create &amp; Delete a Directory in Linux\" \/>\n<meta property=\"og:description\" content=\"Learn step-by-step how to create and delete directories in Linux using simple commands. Perfect for beginners and system administrators looking to manage files efficiently.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"How To Guides\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-04T11:43:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-07T11:26:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Manvinder Singh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manvinder Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/\"},\"author\":{\"name\":\"Manvinder Singh\",\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/#\\\/schema\\\/person\\\/67e44648c1e60cf8a04bc0bf53c227d7\"},\"headline\":\"How to Create &#038; Delete a Directory in Linux\",\"datePublished\":\"2025-07-04T11:43:10+00:00\",\"dateModified\":\"2025-07-07T11:26:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/\"},\"wordCount\":948,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/Frame-1321317395.webp\",\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/\",\"url\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/\",\"name\":\"How to Create & Delete a Directory in Linux\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/Frame-1321317395.webp\",\"datePublished\":\"2025-07-04T11:43:10+00:00\",\"dateModified\":\"2025-07-07T11:26:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/#\\\/schema\\\/person\\\/67e44648c1e60cf8a04bc0bf53c227d7\"},\"description\":\"Learn step-by-step how to create and delete directories in Linux using simple commands. Perfect for beginners and system administrators looking to manage files efficiently.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/Frame-1321317395.webp\",\"contentUrl\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/wp-content\\\/uploads\\\/2025\\\/07\\\/Frame-1321317395.webp\",\"width\":1200,\"height\":675,\"caption\":\"how to create a directory in linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/how-to-create-and-delete-directory-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create &#038; Delete a Directory in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/#website\",\"url\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/\",\"name\":\"How To Guides\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/#\\\/schema\\\/person\\\/67e44648c1e60cf8a04bc0bf53c227d7\",\"name\":\"Manvinder Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4373df1ab2b4f1e40b27df8913e40d494a7fd38d128e0ac30e9f7406a4f96e91?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4373df1ab2b4f1e40b27df8913e40d494a7fd38d128e0ac30e9f7406a4f96e91?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4373df1ab2b4f1e40b27df8913e40d494a7fd38d128e0ac30e9f7406a4f96e91?s=96&d=mm&r=g\",\"caption\":\"Manvinder Singh\"},\"description\":\"Manvinder Singh is the Founder and CEO of HostingSeekers, an award-winning go-to-directory for all things hosting. Our team conducts extensive research to filter the top solution providers, enabling visitors to effortlessly pick the one that perfectly suits their needs. We are one of the fastest growing web directories, with 500+ global companies currently listed on our platform.\",\"sameAs\":[\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\"],\"url\":\"https:\\\/\\\/www.hostingseekers.com\\\/how-to\\\/author\\\/manvinder-singh\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create & Delete a Directory in Linux","description":"Learn step-by-step how to create and delete directories in Linux using simple commands. Perfect for beginners and system administrators looking to manage files efficiently.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Create & Delete a Directory in Linux","og_description":"Learn step-by-step how to create and delete directories in Linux using simple commands. Perfect for beginners and system administrators looking to manage files efficiently.","og_url":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/","og_site_name":"How To Guides","article_published_time":"2025-07-04T11:43:10+00:00","article_modified_time":"2025-07-07T11:26:45+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395.webp","type":"image\/webp"}],"author":"Manvinder Singh","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Manvinder Singh","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/#article","isPartOf":{"@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/"},"author":{"name":"Manvinder Singh","@id":"https:\/\/www.hostingseekers.com\/how-to\/#\/schema\/person\/67e44648c1e60cf8a04bc0bf53c227d7"},"headline":"How to Create &#038; Delete a Directory in Linux","datePublished":"2025-07-04T11:43:10+00:00","dateModified":"2025-07-07T11:26:45+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/"},"wordCount":948,"commentCount":0,"image":{"@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395.webp","articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/","url":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/","name":"How to Create & Delete a Directory in Linux","isPartOf":{"@id":"https:\/\/www.hostingseekers.com\/how-to\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395.webp","datePublished":"2025-07-04T11:43:10+00:00","dateModified":"2025-07-07T11:26:45+00:00","author":{"@id":"https:\/\/www.hostingseekers.com\/how-to\/#\/schema\/person\/67e44648c1e60cf8a04bc0bf53c227d7"},"description":"Learn step-by-step how to create and delete directories in Linux using simple commands. Perfect for beginners and system administrators looking to manage files efficiently.","breadcrumb":{"@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/#primaryimage","url":"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395.webp","contentUrl":"https:\/\/www.hostingseekers.com\/how-to\/wp-content\/uploads\/2025\/07\/Frame-1321317395.webp","width":1200,"height":675,"caption":"how to create a directory in linux"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hostingseekers.com\/how-to\/how-to-create-and-delete-directory-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hostingseekers.com\/how-to\/"},{"@type":"ListItem","position":2,"name":"How to Create &#038; Delete a Directory in Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.hostingseekers.com\/how-to\/#website","url":"https:\/\/www.hostingseekers.com\/how-to\/","name":"How To Guides","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hostingseekers.com\/how-to\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.hostingseekers.com\/how-to\/#\/schema\/person\/67e44648c1e60cf8a04bc0bf53c227d7","name":"Manvinder Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4373df1ab2b4f1e40b27df8913e40d494a7fd38d128e0ac30e9f7406a4f96e91?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4373df1ab2b4f1e40b27df8913e40d494a7fd38d128e0ac30e9f7406a4f96e91?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4373df1ab2b4f1e40b27df8913e40d494a7fd38d128e0ac30e9f7406a4f96e91?s=96&d=mm&r=g","caption":"Manvinder Singh"},"description":"Manvinder Singh is the Founder and CEO of HostingSeekers, an award-winning go-to-directory for all things hosting. Our team conducts extensive research to filter the top solution providers, enabling visitors to effortlessly pick the one that perfectly suits their needs. We are one of the fastest growing web directories, with 500+ global companies currently listed on our platform.","sameAs":["https:\/\/www.hostingseekers.com\/how-to"],"url":"https:\/\/www.hostingseekers.com\/how-to\/author\/manvinder-singh\/"}]}},"_links":{"self":[{"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/posts\/1545","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/comments?post=1545"}],"version-history":[{"count":12,"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/posts\/1545\/revisions"}],"predecessor-version":[{"id":1559,"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/posts\/1545\/revisions\/1559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/media\/1546"}],"wp:attachment":[{"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/media?parent=1545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/categories?post=1545"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostingseekers.com\/how-to\/wp-json\/wp\/v2\/tags?post=1545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}