chmod 775 on a folder but not all files under that folder

送分小仙女□ 提交于 2019-12-22 03:59:05

问题


by assigning 775 rights of user to a folder (project) does that impact the files permissions under the folder?

# chown -R root:user1 /var/www/project/
# chmod 775 -R /var/www/project/

Meaning, if /project/config.html used to have a 664 right does that mean that 664 right disappears and grants 775? How to avoid this to happen? There are files and folders with different rights under /project/ and I do not want these to be overridden.


回答1:


Remove the -R flag. That means it changes all files and folders in the subdirectory as well.

# chown root:user1 /var/www/project/
# chmod 775 /var/www/project/



回答2:


Yes : -R means recursive. Remove -R



来源:https://stackoverflow.com/questions/20400870/chmod-775-on-a-folder-but-not-all-files-under-that-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!