Question regardin chmod/subdirectories

Yohhan

Senior member
May 17, 2002
263
0
0
I'm using redhat hat, distro 8.0

I want to be able to chmod a directory, so every subdirectory beneath it (and any subdirectories created later) will have the same permissions. How can I do this?

At the moment, it appears I have to go through and set the permissions for each new sub-folder that I create.

Thanks ahead.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You can't, new files permissions are determined by the processes umask. the umask is the opposite of the rights you want assinged, so if you want 770 assigned to the new files your umask would be 007. Just set that in your shells settings (.bash_profile for bash) and you should be good.
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0
if you quickly need to give all files under a subdirectory the same permissions, you can use chmod -R to apply them recursively. the only problem with this is that it will apply the perms to all files and subdirectories, and dirs need the execute bit, while files dont. ho hum.