What permissions are set by the -m 750 option in the mkdir command?

The -m 750 option in the mkdir command sets the permissions for the newly created directory as follows:

Breakdown of 750:

  • First Digit (7): Permissions for the owner of the directory.

    • 4 (read) + 2 (write) + 1 (execute) = 7
    • This means the owner has read, write, and execute permissions.
  • Second Digit (5): Permissions for the group.

    • 4 (read) + 1 (execute) = 5
    • This means the group has read and execute permissions, but no write permission.
  • Third Digit (0): Permissions for others.

    • 0 means no permissions for others.

Summary:

Using mkdir -m 750 directory_name creates a directory where:

  • The owner has full access (read, write, execute).
  • The group can read and execute but cannot write.
  • Others have no access at all.

This setting is often used for directories that need to be accessible to the owner and a specific group, while keeping them secure from other users. If you have any further questions or need more clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!