权限chown、chmod

12 篇文章 0 订阅
/etc/passwd    「 thomas:x:1000:1000:wenhuangwei:/home/thomas:/bin/bash 」 
/etc/shadow    「 thomas:04Ru0f1ABltJQ::0:99999:7::: 」 
/etc/group        「 thomas:x:1000:thomas 」 
d[ 类型 ]    rwx[ 主u ]    r-x[ 组g ]    r-x[ 他o ]    .    2[ 硬连接 ]     root[ 作者 ]     root[ 组 ]     4.0K[ 大小 ]     Jun 22 15:45[ 时间 ]    run[ 文件名 ]
-普通文件、d目录、b存储设备、c鼠标键盘tty设备、l软连接
ls -lh /dev/sda1    「 硬盘文件 brw-rw----. 」 
ls -lh /dev/tty        「终端文件 crw-rw-rw-. 」 
r读    w写    x执行    -缺省
a=ugo
chmod u+x,g+w,o-r a.txt
chmod ug-rw a.txt
chmod a=r a.txt
chmod +x a.txt    「 所有」 
4=r    2=w    1=x    0=-
755=rwx r-x r-x
chmod 755 a.txt
ls -ld ~    「 -d目录自身 」
chmod -R 755 /a/    「 -R 递归改目录」 
chown tom /a/
chown tom:tom /a/    「 用户:所属组」 
chgrp root /a/    「 改组」 
chown -R tom /a/    「 -R 递归改目录」
x:对于文件可运行;对于文件夹可cd
文件后缀    「 无实际意义 」 
file nginx.pid    「 查看文件类型  」 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值