dissolved
asked on
umask?
When would you use umask? Cant you just use chmod instead? I know umask is used to set default permissions, but I do not understand when/how it would be used. Can anyone shed some light?
Thanks
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I just checked my box, my umask is set to 022. So this means when I create new files, they will have a default permission of what?
thanks!
thanks!
depends on what permissions you give when you create the file. From the permission bits that you supply, the umask is deducted.
for eg, if you touch a file (which gives, I believe 666 file prmissions), the actual permissions that the file gets is 644. ie -rw-r--r--
ASKER
what are default permissions?
Say I do a cat > test.txt
garbage here
CTRL Z
ls -l is showing rw - r -r , which means default permissions were probably 666 (since my umask is 022). Am I correct?
Thanks for all the help
Say I do a cat > test.txt
garbage here
CTRL Z
ls -l is showing rw - r -r , which means default permissions were probably 666 (since my umask is 022). Am I correct?
Thanks for all the help
Yes. cat, touch etc all give a default file permission of 666.
ASKER
thanks a lot!
ASKER