Linux: Set permission only to directories

后端 未结 6 1833
盖世英雄少女心
盖世英雄少女心 2021-01-30 07:07

I have to change the permissions of the htdocs directory in apache to a certain group and with certain read/write/execute.

The directories need to have 775

6条回答
  •  伪装坚强ぢ
    2021-01-30 08:01

    Use find's -type option to limit actions to files and directories. Use the -o option to specify alternate actions for different types, so you only have to run find once, rather than separately for each type.

    find htdocs -type f -exec chmod 664 {} + -o -type d -exec chmod 775 {} +
    

提交回复
热议问题