赞
踩
[root@lemontree ~]ll
#第一位:文件格式;2-4:该文件拥有者的读写执行权限;5-7:该组成员的读写执行权限;8-10:其他人的读写执行权限
-rw-r--r--. 1 root root 988 3月 12 15:52 test.txt
#读写权限 拥有者 组名称 大小 最后修改时间 文件名称
touch file #创建文件
chmod a=rwx file #给所有人读写执行权限
chmod a=-rwx file #取消所有的读写权限
chmod u=rwx,g=rw,o=- file #属主读写执行,属组读写,其他人无权限
chmod 644 file #rw- r-- r--
chmod 600 file #rw- --- ---
mkdir dir
chmod 777 dir/ #修改目录允许所有人
chmod -R 755 dir/ #修改目录及子目录的权限
# 属主名 属组名 文件名
chown username.username test.txt
#仅变更属组 属组名 文件名
chown .username test.txt
# 属组名 文件名
chgrp username test.txt #只能变更属组
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。