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

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的权限

你可能感兴趣的:(Linux,Linux,chown,chgrp,umask)