关于umask

/etc/profile里面的umask字段

# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi

/etc/bashrc里面的umask字段
# By default, we want umask to get set. This sets it for non-login shell.
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
umask 002
else
umask 022
fi

if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
如果UID大于199,而且用户名和组名一样,就把umask设为002.

原创文章,转载请注明: 转载自笛声

本文链接地址: 关于umask

暂无评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注