About 20,300,000 results
Open links in new tab
  1. Mastering `mkdir -p` in Linux: A Comprehensive Guide

    Nov 14, 2025 · When you use mkdir -p, the command will create the specified directory and all its parent directories if they don't already exist. This is particularly useful when you need to create …

  2. unix - mkdir's "-p" option - Stack Overflow

    -p is a switch, which is optional. It will create a subfolder and a parent folder as well, even if parent folder doesn't exist. From the man page: Example: This will create subfolder …

  3. How to Create Directory in Linux | mkdir Command

    Nov 3, 2025 · If we do not specify the -p option, and request the creation of directories, where parent directory doesn't exist, we will get the following output - mkdir first/second/third

  4. mkdir Command in Linux with Examples - LinuxCapable

    Nov 17, 2025 · Add -p to the mkdir invocation (mkdir -p -- "$dir") when the list includes nested paths so parent directories are created automatically. This pattern is useful when provisioning …

  5. Linux Mkdir Command - Computer Hope

    Jun 1, 2025 · If the Documents folder does not already exist, specify the -p option to create it automatically, otherwise the command fails. You can use the -m option to set a file mode …

  6. Mastering bash mkdir -p for Effortless Directory Creation

    To create a directory along with its necessary parent directories, the `-p` option is used as follows: This command allows Bash to create the entire path specified. If any part of the path does not …

  7. linux - What does the -p flag do in "mkdir -p"? - Super User

    Jul 19, 2010 · The -p flag will create nested directories, but only if they don't exist already. For example, suppose you have a directory /foo that you have write permissions for.

  8. Bash mkdir Command - Make Directories - W3Schools

    To create a new directory, use mkdir directory_name: The mkdir command has several options to customize its behavior: The -p option lets you create parent directories as needed. The -v …

  9. mkdir - Wikipedia

    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.

  10. Use mkdir Command on Linux: A Comprehensive Guide

    Sep 21, 2025 · Now that you know how to use the mkdir command to create multiple directories, we can start learning how to use the -p option for creating parent directories. By default, using …