您的位置:首页 > 运维架构 > Linux

linux 命令系列之用户与组、缺省权限(6)

2015-04-22 20:10 148 查看
chown : change file ownership 更改文件的所属用户

chown [用户名] [文件/目录]

chown user1 /tmp/canglaoshi 或 chown user1 /tmp/canglaoshi/

chgrp: change file group owership 更改文件的所属组

chgrp [用户名] [文件/目录]

chgrp root /tmp/canglaoshi 或 chgrp root /tmp/caolaoshi/

umask: the use file-creation mask 默认用户创建文件、目录权限

输入 umask -S 得到结果u=rwx,g=rx,o=rx (755)

输入 umask 得到结果 0 022 (即777-755)

若要是创建文件有指定的权限 eg: rwxr--r-- (即:744) 用 777-744 得到033

再使用 umask 033 那么现在创建的文件就是744的权限
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: