Re: Question about umask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2005-01-18 at 12:04 +0800, chi wrote:
> iin /etc/bashrc the umask is 022
> then why when i create file , the permission is 664 not 755
> Thx
> 

2 reasons.
first:  By default a file is never created with the executable bit set,
but directories are.
Thus, a umask of 022 will create directories with 755 but files with 644
permissions.

Second:  The settings in /etc/bashrc are overridden by later settings.
I suspect that you may have a umask of 002 set in ~/.bashrc or
~/.bash_profile

To find out what your umask currently is use the command "umask".  Mine
gives
[jeff@goliath ~]$ umask
0002

Also, in my /etc/bashrc I see this related to the umask
--------------------------
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
        umask 002
else
        umask 022
fi
--------------------------------------------
Which says if your uid == gid and your id is >99 then use 002, otherwise
use 022.  That explains mine. (uid=500, gid=500).




[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux