How to create a directory and give permission in single command

后端 未结 8 1983
日久生厌
日久生厌 2021-01-29 23:27

How to create a directory and give permission in single command in Linux?

I have to create lots of folder with full permission 777.

Commands

8条回答
  •  故里飘歌
    2021-01-29 23:59

    When the directory already exist:

    mkdir -m 777 /path/to/your/dir
    

    When the directory does not exist and you want to create the parent directories:

    mkdir -m 777 -p /parent/dirs/to/create/your/dir
    

提交回复
热议问题