问题:
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
来源:oschina
链接:https://my.oschina.net/u/3797416/blog/4475603