Chinaunix首页 | 论坛 | 博客
  • 博客访问: 134030
  • 博文数量: 22
  • 博客积分: 1415
  • 博客等级: 上尉
  • 技术积分: 230
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-23 10:19
文章分类

全部博文(22)

文章存档

2010年(1)

2008年(6)

2007年(12)

2006年(3)

我的朋友

分类: LINUX

2007-11-16 09:30:15

 
chmod ugo+r file1.txt
将档案file1.txt 设为所有人皆可读取:
chmod a+r file1.txt
将档案file1.txt 与file2.txt 设为该档案拥有者,与其所属同一个群体者可写入﹐但其它以外的人则不可写入:
chmod ug+w,o-w file1.txt file2.txt
将ex1.py 设定为只有该档案拥有者可以执行:
chmod u+x ex1.py
将目前目录下的所有档案与子目录皆设为任何人可读取:
chmod -R a+r *
此外chmod也可以用数字来表示权限如chmod 777 file
语法为:chmod abc file
其中a,b,c各为一个数字,分别表示User、Group、及Other的权限。
r=4,w=2,x=1 若要rwx属性则4+2+1=7; 若要rw-属性则4+2=6; 若要r-x属性则4+1=7。
范例:
chmod a=rwx file

chmod 777 file
效果相同
chmod ug=rwx,o=x file

chmod 771 file
66
阅读(2293) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-04-24 11:20:50

若要r-x属性则4+1=7_______________>若要r-x属性则4+1=5