语法:chmod abc file
当中a,b,c各为一个数字,a表示User,b表示Group,c表示Other的权限。
r=4,w=2。x=1
若要rwx(可读、可写、可运行)属性,则4+2+1=7
若要rw-(可读、可写、不可运行)属性,则4+2=6
若要r-w(可读、不可写、可运行)属性,则4+1=5
范例:
chmod a=rwx file 和 chmod 777 file 效果同样
chmod ug=rwx,o=x file 和 chmod 771 file 效果同样
若用chmod 4755 filename可使此程式具有root的权限