I have a folder hierarchy that I want to change the group ownership including any subsequent file/folder additions. I was going to use chmod g+s but I'm not sure if it applies to already created folders and how I run that with the group name.
feedback
|
|
you can use
That will change the group owner recusively in folder , and sub-folders, and their respective files | |||
|
feedback
|
|
g+s adds the "setgid" bit which basically only affects the default behavior of creating new files. (in short... any new files/directories created will have the group set to the group of the parent folder) you could simply
to change the group of the files under "some_directory" to "group-name" recursively (-R) | |||||||
feedback
|
|
The (very slightly) expand on the existing answers, you'll probably want to both recursively set the ownership on any existing files and directories and the setgid bit on any existing directories. That is, if your hierarchy already has existing files and directories. If it doesn't, you don't need to worry about the recursive part. Something like this:
and you're set. Now if you want to ensure certain rwx permissions on files/dirs copied or moved into the hierarchy, that's a bit trickier. You'll likely need to use default ACLs but the Linux ACL implementation (based on a dead POSIX proposal, I believe) doesn't always work as one might expect. | |||
|
feedback
|