DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Customizing your environment

Setting your file creation mask

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.


Next topic: Configuring mail
Previous topic: Changing permissions with absolute mode

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003