Home > Archive > Linux/Unix > May 2004 > unix mask update





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author unix mask update
Duckhunt

2004-05-24, 8:13 pm

sorry said it wrong question is how can you what is the unix mask, and how do you set it
Supertech

2004-05-24, 8:17 pm

mask --
A series of bit settings that ``cover up'' existing settings, only allowing some settings to show through, while masking out others.

To control the default permissions that are given to every new file you create, you use the umask (user mask) command.

The umask command sets up a file creation mask. Setting a mask is the opposite of setting the permissions themselves; when you set a mask, you are telling the computer the permissions you do not want, rather than the permissions you do.

To set the default file permissions on new files you create to rw-r-----, you could add the following line to your .profile or .login:

umask 137

This is the opposite of saying chmod 640. If you wanted to set a umask for rw-rw----, it would be:
umask 117

A umask that allowed read and write permission for everyone would be:
umask 111

A umask that denied permissions to everyone except the owner of the file would be:
umask 177

You can see your current umask by typing umask and pressing <Enter>. If umask is not explicitly set in one of your shell startup files, the computer shows you a default umask.
You can change your umask at the command line by typing umask, then the value you want your mask to have, then pressing <Enter>. Keep changing your umask and creating and listing files until you get the default permissions you want.
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net