Last active
March 4, 2019 12:59
-
-
Save jonathborg/37f6a6a80131cefe6011e847738d2ed9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://askubuntu.com/a/51953 | |
// If you want all new files in a particular directory to be owned by a particular group, just apply the setgid bit on it: | |
chmod -R 755 /some/dir | |
chgrp www-data /some/dir | |
chmod g+s /some/dir | |
// If you have an existing tree of directories that you want to apply this behaviour to, you can do so with find: | |
find /some/dir -type d -exec chgrp www-data {} + | |
find /some/dir -type d -exec chmod g+s {} + | |
// (if the directories are already owned by the relevant group, then you can omit the first command in both of these examples). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment