Operating System - HP-UX
1834653 Members
2575 Online
110069 Solutions
New Discussion

how to set the default permission as "rwx" pls.

 
Ramana.Sv
Frequent Advisor

how to set the default permission as "rwx" pls.

Hi, when i list out the files in murali login the files permission in the user also having "rw" how to set the default for "rwx" for user group, below are the exampls

India:murali $ ls -l
total 4
-rw-rw-r-- 1 murali users 47 Aug 3 18:41 abc
-rw-rw-r-- 1 murali users 116 Aug 3 18:33 asdsa

Thank you,
Ramana.
4 REPLIES 4
Luk Vandenbussche
Honored Contributor

Re: how to set the default permission as "rwx" pls.

do it with the command umask

=> umask 774 (fe)

check also 'man umask'
Oviwan
Honored Contributor

Re: how to set the default permission as "rwx" pls.

you can set umask in your $HOME/.profile so you have this settings after each login.
Juan M Leon
Trusted Contributor

Re: how to set the default permission as "rwx" pls.

I will suggest to use 023 which equeal to

754
user is rwx
group is r-x
other is r

A. Clay Stephenson
Acclaimed Contributor

Re: how to set the default permission as "rwx" pls.

In order to create files with permissions
-rwxrwx---, a umask of 007 would be required; however, that still won't work because there are two things in play when files are created: mode and umask. Umask then "subtracts" (actually a bitwise NAND) from the mode to yield the effective mode (permissions) of the new file. However, umask cannot "subtract" what is not already there. The mode for regular files under the shell is -rw-rw-rw- (666) and for directories it is -rwxrwxrwx (777). No setting of umask will ever set the execute bit on a file created in the shell. You must do an explicit chmod after the file is created. If you are creating a file under other circumstances (Perl, C, ...) then you can assert the mode of the file as you create it and do it without an explicit chmod.
If it ain't broke, I can fix that.