Created
April 2, 2018 09:22
-
-
Save asahasrabuddhe/c7a690b3bb1f70fa1645c7d8869c73b4 to your computer and use it in GitHub Desktop.
Directory and File Permissions
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
#Find all files in the given path and apply permissions 664 to them | |
sudo find <path> -type f -exec chmod 664 {} \; | |
#Find all directories in the given path and apply permissions 775 to them | |
sudo find <path> -type d -exec chmod 775 {} \; | |
#Set the group id on the directory so that the files created in this directory in the future are automatically owned by the group | |
sudo find <path> /var/www -type d -exec chmod g+s {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment