Linux 不同颜色文件类型 / 权限 / 属性

Linux 的文件基本上分为三个属性:可读( r ),可写( w ),可执行( x )

(以 -rwxr-xr-x 为例):   rwx(Owner)r-x(Group)r-x(Other)

表示的权限是:使用者自己可读,可写,可执行;同一组的用户可读,不可写,可执行;其它用户可读,不可写,可执行。

chmod [-R] xyz 文件或目录 
xyz 为三組 rwx 属性数值的相加

同一组的数字是相加!如属性为 [ -rwxrwx— ] ,则: 
owner  = rwx  = 4+2+1 = 7 
group  = rwx  = 4+2+1 = 7 
others = —  = 0+0+0 = 0

[root@test root]# ls –al .bashrc 
-rw-r–r–    1 root     root          226 Feb 16  2002 .bashrc 
[root@test root]# chmod 777 .bashrc 
[root@test root]# ls –al .bashrc 
-rwxrwxrwx    1 root     root          226 Feb 16  2002 .bashrc

原文地址:https://www.cnblogs.com/suxiaolong/p/5726296.html