Create File with permissions

Currently when I create a file on our Solaris 7 server it creates it with this:-rw-r--r--1 jones abcd0 Jul 25 14:46 datafilePlease advise how I can change it so everytime I create a file it will be with these permissions:-rw-rw-r--1 jones abcd0 Jul 25 14:46 datafile
[294 byte] By [teser2] at [2007-11-26 9:02:32]
# 1

enter:

umask 002

Then, all new files will have the permissions you requested while you are still logged in.

To make it permanent every time you log in, append that to your shell profile like this:

echo "umask 002" >> ~/.profile

Message was edited by:

bek

bek at 2007-7-6 23:10:19 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 2
Thanks,Can you also advise what it would be in the csh?I assume I would have to edit it in the .login file of my home csh?
teser2 at 2007-7-6 23:10:19 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 3

Actually, what you need to set your umask to, depends on the rest of the system.

First check in /etc/default/login for the system wide UMASK setting. This is the one that applies to you. You should start calculating from there :)

See also:

====================

The three

octal digits refer to read/write/execute permissions for

owner, group, and other, respectively(seechmod(1),

chmod(2), and umask(2)). The value of each specified digit

is subtracted from the corresponding ``digit'' specified by

the system for the creation of a file (see creat(2)). For

example, umask 022 removes write permission for group and

other (files normally created with mode 777 become mode 755;

files created with mode 666 become mode 644).

====================

Message was edited by:

Cailin_Coilleach

Cailin_Coilleach at 2007-7-6 23:10:19 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...