chmod命令详解

https://blog.csdn.net/u010429424/article/details/48498081

(1)chmod [ u / g / o / a ] [ + / - / = ] [ r / w / x ] file

 例如:sudo chmod u+rw ubandy-rest/job/views.py

(2)chmod [xyz] file

其中,x,y,z分别表示数字(最大不超过7),并分别对应User、Group、Other

x,y,z的值由r(r=4),w ( w=2 ),x ( x=1 )来确定

例如:sudo chmod 765 ubandy-rest/authentication/models.py

当然,你也可以使用通配符 ‘*’,来设置当前路径下的所有文件的权限

For example:

假如,当前你的路径下有文件:1.txt, 2.html, 3.py

使用命令:

chmod 777 *

可以同时设置上述三个文件的权限为rwx

修改整个文件夹的权限,比如你有一个文件夹WhoJoy

chmod -R 777 WhoJoy/

其中:-R表示以递归整个文件夹中的子文件

原文地址:https://www.cnblogs.com/csdeblog/p/10072417.html