Forrest logo
back to the mkdir tool

mkdir:tldr:b3874

mkdir: Create directories with specific permissions.
$ mkdir -m ${rwxrw-r--} ${path-to-directory1 path-to-directory2 ---}
try on your machine

The command mkdir is used in Unix-like operating systems to create directories. Here is the breakdown of the provided command:

  • mkdir: This calls the "make directory" command.

  • -m: This is an option used to specify the permissions of the directory being created. In this case, ${rwxrw-r--} is a placeholder for the desired permissions. It represents the following permissions:

    • rwx: Read, write, and execute permissions for the owner of the directory.
    • rw-: Read and write permissions for the group associated with the directory.
    • r--: Read-only permissions for other users.
  • ${path-to-directory1 path-to-directory2 ---}: These are placeholders for the paths to the directories you want to create. Simply replace them with the actual paths to the directories you wish to make. Also note that you can add more directory paths separated by spaces.

For example, if you wanted to create two directories named "dir1" and "dir2" with the same permissions mentioned above, you could use the following command:

mkdir -m rwxrw-r-- dir1 dir2

This would create the directories "dir1" and "dir2" with the specified permissions.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mkdir tool