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!

setting rwx permissions on a directory and any newly created sub

Status
Not open for further replies.

teakandme

MIS
Jun 10, 2004
57
US
How can you set a directory permission to have rwx on the group and have any newly created subdirectory have rwx permission as well without having to change it after the subdirectory is created?
 
For more info on this:


Code:
-m Mode 	Sets the permission bits for the newly-created directories to the value specified by the Mode variable. The Mode variable takes the same values as the Mode parameter for the chmod command, either in symbolic or numeric form.

When you specify the -m flag using symbolic format, the op characters + (plus) and - (minus) are interpreted relative to the assumed permission setting a=rwx. The + adds permissions to the default mode, and the - deletes permissions from the default mode. Refer to the chmodcommand for a complete description of permission bits and formats.

Regards,
Khalid
 
I dont think so it can.
but why not set the umask or run "chmod -R 775 /dir"?
 
The problem with umask that it will change the permission for the whole user session! So mkdir -m is a more direct solution

Regards,
Khalid
 
yep, i knew,
but he want "have rwx permission as well without having to change it after the subdirectory is created"

mkdir -m just work with the dir u created.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top