Generaly, we create directory using “mkdir” command and then change it’s permissions using “chmod” command.

Create directory & set permission using a single Linux command

Actually, we can set the permissions for the directory at the time of it’s creation itself, with the following command:

$ mkdir zyz -v -m 644
mkdir: created directory `zyz'

where,

-m flag defines the permission to be set
-v stands for verbose mode

$ ls -l | grep zyz
drw-r--r--  2 root root  4096 2009-12-30 14:26 zyz

To get updates follow us on Facebook, Twitter, LinkedIn

Subscribe to get free blog content to your Inbox
Loading

  1. Anonymous

    June 4, 2026

    Could you share pricing information? Thanks. (ref:ls23orwf5ry7i7wc)

Post a comment

Your email address will not be published.

Related Posts