| |
 |
|
Oracle Tips by Burleson |
Setting default permissions using a file mask
By default, Linux permissions for new directories are set to 777
allowing read, write, and execute permissions to user, group,
and other users. Conversely, file permissions default to 666
allowing read and write access to user, group, and others. The
System Administrator will often change the Linux default
permissions by using the umask command in a login script.
You can use the umask command without specifying any
arguments to determine what your current default permissions
are. The value displayed by umask must be subtracted from the
defaults of 777 (directories) and 666 (files) to determine your
current defaults. Use the –S option to see the current default
permissions displayed in the alpha symbolic format. You can
change your default permissions by specifying the mode
argument to umask within your shell profile (.bash_profile)
script.
Here are some examples.
Using umask to set default permissions
$ umask
0022
$ umask -S
u=rwx,g=rx,o=rx
$ umask 033
$ umask
0033
$ umask -S
u=rwx,g=r,o=r
You’ll notice that umask displays a 4-digit permissions mask, but
only the last 3 digits represent the mask for owner, group, and
others.
The above book excerpt is from:
Easy Linux
Commands
Working Examples of Linux Command Syntax
ISBN:
0-9759135-0-6
Terry Clark
http://www.rampant-books.com/book_2005_1_linux_commands.htm |