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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CHMOD 1

Status
Not open for further replies.

dmoccia

IS-IT--Management
Jan 15, 2001
12
DE
Hi folks,
I need all files that are being created in a certain directory and subdirectory to automatically have certain permissions 666 and the directories must be 777.
For instance:
/dir1 --> 777 rwxrwrxrwx
file1 --> 666 rw-rw-rw
/dir1/dir2 -->777
file3--> 666

Any idea if and how that might work ?

Thanks in advance !

Regards.
Domenico
 
Set your directories up appropriately then use umask to set the default file creation settings.
 
Thank Ken,
but the umask command runs only for new files ?
If the direcories and subdirectories and files already existing, what is necessary to do ?

Regards.
DM
 
cd to the directory above the directory and chmod 777 <directoryname> Then cd into the directory and chmod 666 * to change the files in it. chmod 777 and subdirs after this if that's what you need to do. If there are lots of subdirs, you might try (from the parent directory):

find . -type d -exec chmod 777 {} \;

HTH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top