Re: Question about umask

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

 



On Monday 17 January 2005 23:04, chi wrote:
> iin /etc/bashrc the umask is 022
> then why when i create file , the permission is 664 not 755
> Thx

The umask masks the permission the program you're working with uses. So if the 
program tries to create files with 664 permissions and your umask is 022, you 
will end up with 644. 
By default most programs create 664. the lowest numbered bit is the executable 
bit and if you have data files there is no reason for having it set. 
Compilers for example create executables so they will set the x bit.

[loony@lap tmp]$ umask 022
[loony@lap tmp]$ cat a.c
int main () {
        return 1;
}
[loony@lap tmp]$ gcc -o a a.c
[loony@lap tmp]$ ls -la a
-rwxr-xr-x  1 loony loony 4617 Jan 17 23:04 a
[loony@lap tmp]$


Peter.


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

  Powered by Linux