chmod改变权限

hmod 改变文件权限属性有两种方式:


* 数字

owner/group/others 组的 read/write/excute

r:4
w:2
x:1
例如 [-rwxrwx---] 是:
owner = rwx = 4+2+1 = 7
group = rwx = 4+2+1 = 7
others= --- = 0+0+0 = 0
 
例如 :chmod  754 test.txt
若要改变一个目录权限时 为  chmod -R 


* 字母 

u  (1)user 
g  (2)group
o  (3)others
a  (4)all

+(加入)
-(除去)
=(設定)
r 可读
w 可写
x 可执行

例如:  chmod u=rwx,g=rx,o=r filename  user(owner)=读写执行  group=读执行 other=读
 
  chmod  a+w  test.txt       all(user 、group 、other) 都增加写的权限    
  chmod  a-w   test.txt  all 都减去写的权限
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值