如何在Linux中一步更改文件夹及其所有子文件夹和文件的权限? [关闭]

南笙酒味 提交于 2020-10-20 13:11:27

问题:

I would like to change permissions of a folder and all its sub folders and files in one step (command) in Linux. 我想在Linux中一步(命令)更改文件夹及其所有子文件夹和文件的权限。

I have already tried the below command but it works only for the mentioned folder: 我已经尝试过以下命令,但它仅适用于上述文件夹:

chmod 775 /opt/lampp/htdocs

Is there a way to set chmod 755 for /opt/lampp/htdocs and all of its content including subfolders and files? 有没有办法为/opt/lampp/htdocs设置chmod 755及其所有内容,包括子文件夹和文件?

Also, in the future, if I create a new folder or file inside htdocs , how can the permissions of that automatically be set to 755 ? 此外,将来,如果我在htdocs创建一个新的文件夹或文件,它的权限如何自动设置为755

I had a look at this link too: 我也看过这个链接:

http://stackoverflow.com/questions/3740187/how-to-set-default-chmod-in-linux-terminal http://stackoverflow.com/questions/3740187/how-to-set-default-chmod-in-linux-terminal


解决方案:

参考一: https://stackoom.com/question/Fgz2/如何在Linux中一步更改文件夹及其所有子文件夹和文件的权限-关闭
参考二: https://oldbug.net/q/Fgz2/How-do-I-change-permissions-for-a-folder-and-all-of-its-subfolders-and-files-in-one-step-in-Linux-closed
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!