Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

umask command 1

Status
Not open for further replies.

tg2003

IS-IT--Management
Feb 6, 2003
270
IL
Hello,
I have a question about the using of this command:

although my umask is 002,
when I create a file with this umask, I still get permissions like that:
-rw-rw-r--

why? where is the 'x' (executable) permission gone?

Thanx,
 
The normal default umask value is 022 this value is subtracted from the default file permission of 666 in the case of a file which would give the files created a value of 644

This would translate to -rw-r--r-- where the first dash is used for file type in this case a regular file so what you are seeing as a result of setting the umask to 002 is correct.

The execute permission is not normally set by the umask because the assumption is not every file that will be created will need to be executable.

The way that specific file permission can be set is by using the chmod command in a script.

chmod 755 `ls` for example would set the file permission for all the files in the current directory to be

-rwxr-xr-x

I hope this helps you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top